49#ifndef GUM_UTILS_STRING_H
50#define GUM_UTILS_STRING_H
74 std::string
toLower(std::string str);
80 bool endsWith(std::string
const& value, std::string
const& ending);
88 std::vector< std::string >
split(
const std::string& orig,
const std::string& delimiter);
97 std::string
replace(
const std::string& s,
const std::string& val,
const std::string& new_val);
132 void ltrim(std::string& s);
138 void rtrim(std::string& s);
144 void trim(std::string& s);
151 std::string
trim_copy(
const std::string& s);
160 template <
typename T >
162 std::ostringstream s;
std::string getUniqueFileName()
Returns a path to a unique file name.
bool isNumericalWithResult(const std::string &val, double *res)
return true is a string contains a numerical (double) value
std::string replace(const std::string &s, const std::string &val, const std::string &new_val)
not usable for gcc 4.8 std::vector<std::string> split( const std::string& orig, ...
std::string compact_tostr(T value)
Returns a path to a unique file name.
void ltrim(std::string &s)
trim from start (in place)
bool isNumerical(const std::string &val)
return true is a string contains a numerical (double) value
bool isIntegerWithResult(const std::string &val, int *res)
return true is a string contains an integer value
bool isInteger(const std::string &val)
return true is a string contains an integer value
std::string toLower(std::string str)
Returns the lowercase version of str.
void trim(std::string &s)
trim from both ends (in place)
std::string remove_newline(const std::string &s)
remove all newlines in a string
void rtrim(std::string &s)
trim from end (in place)
std::vector< std::string > split(const std::string &str, const std::string &delim)
Split str using the delimiter.
bool endsWith(std::string const &value, std::string const &ending)
Returns true if value ends with ending.
std::string trim_copy(const std::string &s)
trim from both ends (copying)
gum is the global namespace for all aGrUM entities
Contains usefull methods for random stuff.