MCPcopy Create free account
hub / github.com/davisking/dlib / split_on_last

Function split_on_last

dlib/string/string.h:895–906  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

893 typename alloc
894 >
895 std::pair<std::basic_string<charT,traits,alloc>, std::basic_string<charT,traits,alloc> >
896 split_on_last (
897 const std::basic_string<charT,traits,alloc>& str,
898 const charT* delim = _dT(charT," \n\r\t")
899 )
900 {
901 typename std::basic_string<charT,traits,alloc>::size_type delim_pos = str.find_last_of(delim);
902 if (delim_pos != std::basic_string<charT,traits,alloc>::npos)
903 return std::make_pair(str.substr(0, delim_pos), str.substr(delim_pos+1));
904 else
905 return std::make_pair(str, _dT(charT,""));
906 }
907
908 template <
909 typename charT,

Callers 1

test_splitFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_splitFunction · 0.68