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

Function split_on_first

dlib/string/string.h:861–872  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

859 typename alloc
860 >
861 std::pair<std::basic_string<charT,traits,alloc>, std::basic_string<charT,traits,alloc> >
862 split_on_first (
863 const std::basic_string<charT,traits,alloc>& str,
864 const charT* delim = _dT(charT," \n\r\t")
865 )
866 {
867 typename std::basic_string<charT,traits,alloc>::size_type delim_pos = str.find_first_of(delim);
868 if (delim_pos != std::basic_string<charT,traits,alloc>::npos)
869 return std::make_pair(str.substr(0, delim_pos), str.substr(delim_pos+1));
870 else
871 return std::make_pair(str, _dT(charT,""));
872 }
873
874 template <
875 typename charT,

Callers 1

test_splitFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_splitFunction · 0.68