32 vsprintf(buf,
format, args);
38 static inline bool contains(
const std::string& s1,
const std::string& s2)
40 return s1.find(s2) != std::string::npos;
43 static inline bool matches(
const std::string& s,
const std::string& regex)
47 return std::regex_match(s, r);
50 static inline const std::vector<std::string>
split(
const std::string&
string,
51 const std::string& delimiter)
53 std::vector<std::string> tokens;
54 std::string s = string;
58 while ((pos = s.find(delimiter)) != std::string::npos) {
59 tokens.push_back(s.substr(0, pos));
60 s.erase(0, pos + delimiter.length());
static const std::vector< std::string > split(const std::string &string, const std::string &delimiter)
static bool contains(const std::string &s1, const std::string &s2)
static bool matches(const std::string &s, const std::string ®ex)
static const std::string format(const char *format,...)