bool SplitString const std string string const std string delim std ve

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
bool SplitString( const std::string & string,const std::string& delim, std::vector<std::string>& result )
{
std::string workString(string);
size_t cutAt;
while( (cutAt = workString.find_first_of(delim)) != std::string::npos )
{
result.push_back(workString.substr(0,cutAt));
workString = workString.substr(cutAt+1);
}
result.push_back(workString);
return true;
}