25std::vector<csg::string> *csg::string::split(
char splitChar)
27 std::vector<csg::string> *result =
new std::vector<csg::string>;
30 for (
size_t i = 0; i<size(); i++)
32 if ((*
this)[i]==splitChar)
34 result->push_back(word);
38 word.push_back((*
this)[i]);
40 if (word.size()>0) result->push_back(word);
47int main(
int argc,
const char **argv)
49 csg::string string(
"abcdef:abcdefghijk");
51 std::vector<csg::string> *result =
string.split(
':');
53 for (
int i=0; i<result->size(); i++)
55 std::cout << i <<
"\t" << (*result)[i] << std::endl;