49#ifndef GUM_UTILS_STRING_H
50#define GUM_UTILS_STRING_H
76 std::string
toLower(std::string_view str);
84 bool contains(std::string_view s, std::string_view needle);
90 bool endsWith(
const std::string_view& value,
const std::string_view& ending);
98 std::vector< std::string >
split(std::string_view orig, std::string_view delimiter);
107 std::string
replace(std::string_view s, std::string_view val, std::string_view new_val);
142 void ltrim(std::string& s);
148 void rtrim(std::string& s);
154 void trim(std::string& s);
161 std::string
trim_copy(std::string_view s);
170 template <
typename T >
std::string getUniqueFileName()
Returns a path to a unique file name.
bool contains(std::string_view s, std::string_view needle)
true if needle in s
std::string remove_newline(std::string_view s)
remove all newlines in a string
std::string toLower(std::string_view str)
Returns the lowercase version of str.
bool isIntegerWithResult(std::string_view val, int *res)
return true is a string contains an integer value
std::string compact_tostr(T value)
Returns a path to a unique file name.
bool endsWith(const std::string_view &value, const std::string_view &ending)
Returns true if value ends with ending.
std::vector< std::string > split(std::string_view str, std::string_view delim)
Split str using the delimiter.
void ltrim(std::string &s)
trim from start (in place)
std::string trim_copy(std::string_view s)
trim from both ends (copying)
bool isInteger(std::string_view val)
return true is a string contains an integer value
void trim(std::string &s)
trim from both ends (in place)
bool isNumerical(std::string_view val)
return true is a string contains a numerical (double) value
void rtrim(std::string &s)
trim from end (in place)
bool isNumericalWithResult(std::string_view val, double *res)
return true is a string contains a numerical (double) value
std::string replace(std::string_view s, std::string_view val, std::string_view new_val)
Replace val by new_val in s.
gum is the global namespace for all aGrUM entities
Contains useful methods for random stuff.