equiv from python
Burkhard Kloss
bk at xk7.com
Wed Aug 29 09:19:01 EDT 2001
> > >>> import string
> > >>> s='ab:cd:efg:ghi:'
> > >>> print string.splitfields(s,':')
> > ['ab', 'cd', 'efg', 'ghi', '']
> >
> > IE, can the standard c++ library take a string, split it up on a
> > particular separator character, and return the corresponding list of
> > strings?
Boost (http:/www.boost.org) has, among lots of other useful libraries, a
tokenizer. Boost is nice for this kind of stuff becausse
* the code is good
* it integrates well with the standard library
* it has a good chance of making it into the standard next time.
HTH,
Burkhard
More information about the Python-list
mailing list