TF++, Miscellaneous classes and modules in C++:

◆ split()

template<template< class > class C>
C<std::string> tfxx::string::split ( const std::string &  s,
const std::string &  delimiter = " ",
const bool &  dropdelimiter = false 
)

template #tf::split#

Use the following interface to the gen_split function by explicitely passing a template type argument like:

#list<string> l;# #string s="a,b,c,d,e";# #l=split<list>(s);#

This is the inverse operation to #tf::join#.

Returns
seqeunce container containing substrings
Parameters
sstring to be split into substrings
delimiterstring sequence that intersects substrings
dropdelimiterif #true# the delimiter itself will be excluded from the output
Author
Thomas Forbriger
Version
V1.0 (#$Revision: 1.4 $
Date
2009-11-11 12:34:04

#)

See also
join
gen_split adapter to gen_split

Definition at line 159 of file stringfunc.h.

References gen_split().

162  {
163  C<std::string> v;
164  gen_split(v, s, delimiter, dropdelimiter);
165  return(v);
166  }
void gen_split(C &v, const std::string &s, const std::string &delimiter=" ", const bool &dropdelimiter=false)
Definition: stringfunc.h:112
Here is the call graph for this function: