StringUtils.hpp
45 auto stringfy(std::ostringstream& ss, std::string const& sep, Arg const& item, Args... items) -> void
113 auto split(std::string const& str, std::string const& delims, std::function<std::string(std::string)> transform) -> std::vector<std::string>;
116 auto split(std::string const& str, std::string const& delims = " ") -> std::vector<std::string>;
125 auto makeunique(std::vector<std::string> words, std::string suffix) -> std::vector<std::string>;
The namespace containing all components of the Reaktoro library.
Definition: Algorithms.hpp:29
auto trimright(std::string str) -> std::string
Trim the string from end (taken from http://stackoverflow.com/questions/216823/whats-the-best-way-to-...
auto split(std::string const &str, std::string const &delims, std::function< std::string(std::string)> transform) -> std::vector< std::string >
Split the string on every occurrence of the specified delimiters and apply a transform function.
auto strlength(std::string const &str) -> std::size_t
Return the length of the string.
auto tofloat(std::string const &str) -> double
Convert the string into a floating point number.
auto strsci(double num, int precision=-1) -> std::string
Return a string representation for a number in scientific format.
auto replace(std::string original, std::string substr, std::string newsubstr) -> std::string
Return a new string where substr occurrences are replaced by newsubstr.
auto makeunique(std::vector< std::string > words, std::string suffix) -> std::vector< std::string >
Return a list of words with duplicate names converted to unique ones.
auto stringfy(std::string const &sep, Args... items) -> std::string
Concatenate the arguments into a string using a given separator string.
Definition: StringUtils.hpp:55
auto lowercase(std::string str) -> std::string
Return a string with lower case characters.
auto precision(int precision) -> void
Set the global precision used when converting floating-point numbers to string.
auto trimleft(std::string str) -> std::string
Trim the string from start (taken from http://stackoverflow.com/questions/216823/whats-the-best-way-t...
auto strfix(double num, int precision=-1) -> std::string
Return a string representation for a number in fixed format.
auto transform(const Container &c, Result &res, const Function &f)
Apply a function f on every item in container c and store in res.
Definition: Algorithms.hpp:116
auto startswith(std::string const &str, SubStr substr, SubStrs... substrs)
Returns true if string str starts with substr, or any other given sub string in substrs.
Definition: StringUtils.hpp:135
auto uppercase(std::string str) -> std::string
Return a string with upper case characters.
auto endswith(std::string const &str, SubStr substr, SubStrs... substrs)
Returns true if string str ends with substr, or any other given sub string in substrs.
Definition: StringUtils.hpp:145
auto operator<<(std::ostream &out, AggregateState option) -> std::ostream &
Output an AggregateState value.
auto str(Args... items) -> std::string
Concatenate the arguments into a string without any separator string.
Definition: StringUtils.hpp:73
auto join(std::vector< std::string > const &strs, std::string sep=" ") -> std::string
Join several strings into one.
auto trim(std::string str) -> std::string
Trim the string from both ends (taken from http://stackoverflow.com/questions/216823/whats-the-best-w...