Showing posts with label stl. Show all posts
Showing posts with label stl. Show all posts

Sunday, 10 April 2011

Elegant ways to tokenize strings


Last night I posted a solution at stackoverflow. The question was : what is the right way to split a string into a vector of strings. Delimiter is space or comma.

This is what I first came up with, for space separated string: