libept
|
Split a string where a given substring is found. More...
#include <string.h>
Classes | |
class | const_iterator |
Public Member Functions | |
Split (const std::string &str, const std::string &sep, bool skip_empty=false) | |
const_iterator | begin () |
Return the begin iterator to split a string on instances of sep. More... | |
const_iterator | end () |
Return the end iterator to string split. More... | |
Public Attributes | |
std::string | str |
String to split. More... | |
std::string | sep |
Separator. More... | |
bool | skip_empty |
If true, skip empty tokens, effectively grouping consecutive separators as if they were a single one. More... | |
Split a string where a given substring is found.
This does a similar work to the split functions of perl, python and ruby.
Example code:
|
inline |
|
inline |
Return the begin iterator to split a string on instances of sep.
References ept::str::Split::const_iterator::const_iterator().
|
inline |
Return the end iterator to string split.
References ept::str::Split::const_iterator::const_iterator(), ept::str::decode_base64(), ept::str::decode_cstring(), ept::str::decode_url(), ept::str::encode_base64(), ept::str::encode_cstring(), ept::str::encode_url(), and str.
std::string ept::str::Split::sep |
Separator.
Referenced by ept::str::Split::const_iterator::operator++(), and ept::str::Split::const_iterator::skip_separators().
bool ept::str::Split::skip_empty |
If true, skip empty tokens, effectively grouping consecutive separators as if they were a single one.
Referenced by ept::str::Split::const_iterator::const_iterator(), and ept::str::Split::const_iterator::operator++().
std::string ept::str::Split::str |
String to split.
Referenced by end(), ept::str::Split::const_iterator::operator++(), ept::str::Split::const_iterator::remainder(), and ept::str::Split::const_iterator::skip_separators().