Go to the documentation of this file.
10 #ifndef CPROVER_UTIL_STRING_UTILS_H
11 #define CPROVER_UTIL_STRING_UTILS_H
22 std::vector<std::string> &result,
24 bool remove_empty =
false);
37 bool remove_empty =
false);
51 template<
typename Stream,
typename It,
typename Delimiter>
56 const Delimiter &delimiter)
63 for(
auto it=std::next(b); it!=e; ++it)
65 os << delimiter << *it;
72 std::string
escape(
const std::string &);
74 void replace_all(std::string &,
const std::string &,
const std::string &);
void replace_all(std::string &, const std::string &, const std::string &)
Replace all occurrences of a string inside a string.
Stream & join_strings(Stream &os, const It b, const It e, const Delimiter &delimiter)
Prints items to an stream, separated by a constant delimiter.
std::string escape(const std::string &)
Generic escaping of strings; this is not meant to be a particular programming language.
void split_string(const std::string &s, char delim, std::vector< std::string > &result, bool strip=false, bool remove_empty=false)
Given a string s, split into a sequence of substrings when separated by specified delimiter.
std::string trim_from_last_delimiter(const std::string &s, const char delim)
std::string strip_string(const std::string &s)
Remove all whitespace characters from either end of a string.