Skip to content

Instantly share code, notes, and snippets.

@whyrusleeping
Last active December 11, 2015 13:39
Show Gist options
  • Save whyrusleeping/4609397 to your computer and use it in GitHub Desktop.
Save whyrusleeping/4609397 to your computer and use it in GitHub Desktop.
my go to function for splitting a string into a vector of strings
vector<string> oGlModel::splitString(string s, char delim)
{
vector<string> retTok;
int beg=0,end=0;
for(int end = 0; end < s.length(); end++)
{
if(s[end] == delim)
{
retTok.push_back(s.substr(beg,end-beg));
end++;
beg = end;
}
}
retTok.push_back(s.substr(end));
return retTok;
}
@whyrusleeping
Copy link
Author

454,000,000 byte file:
Algorithm Revision 1: 17.886, 12.984, 13.041

@whyrusleeping
Copy link
Author

Algorithm Revision 2: 15.414, 15.203, 15.486

@whyrusleeping
Copy link
Author

Algorithm Revision 3: 4.574, 4.559, 4.657

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment