|
tgbotxx 1.1.9.2
Telegram Bot C++ Library
|
Namespace contains useful string related utility functions. More...
Functions | |
| template<typename T , typename D > | |
| static std::string | join (const std::span< T > &con, const D &delim) |
| Form a string from a container with a delimiter. | |
| template<typename T , typename D > | |
| static std::string | join (const std::vector< T > &con, const D &delim) |
| static std::vector< std::string > | split (const std::string &str, char delim) |
| Split a string by delimiter. | |
| static std::string | toLowerCopy (std::string str) |
| Lowercase a string. | |
| static void | toLower (std::string &str) |
| Lowercase original string str. | |
| static std::string | toUpperCopy (std::string str) |
| Uppercase a string. | |
| static void | toUpper (std::string &str) |
| Uppercase original string str. | |
| static void | ltrim (std::string &str) |
| Left trim a string from start (in place) | |
| static void | rtrim (std::string &str) |
| Right trim a string from end (in place) | |
| static void | trim (std::string &str) |
| Left and right trim a string (from beginning and end) (in place) | |
| static std::string | ltrimCopy (std::string s) |
| Left trim a string from start (copy) | |
| static std::string | rtrimCopy (std::string s) |
| Right trim a string from end (copy) | |
| static std::string | trimCopy (std::string s) |
| Left and Right trim a string from start and end (copy) | |
| static bool | startsWith (const std::string &str, const std::string &prefix, bool ignoreCase=false) |
| Returns true if str starts with prefix. | |
| static bool | endsWith (const std::string &str, const std::string &suffix, bool ignoreCase=false) |
| Returns true if str ends with suffix. | |
| static void | replace (std::string &str, const std::string &search, const std::string &replace) |
| static std::string | replaceCopy (std::string str, const std::string &search, const std::string &replace) |
| template<typename T > | |
| static T | to (const std::string &str) |
| static std::string | random (std::size_t length) |
| Returns a random string of length characters. | |
Namespace contains useful string related utility functions.
|
static |
Returns true if str ends with suffix.
| str | string to check |
| suffix | suffix to check if str ends with it |
| ignoreCase | Case sensitivity, default: false |
Definition at line 141 of file StringUtils.hpp.
|
static |
Form a string from a container with a delimiter.
| con | Container of T elements |
| delim | Text to put between each element T Example: array = [1,2,3] StringUtils::join(array, ",") -> "1,2,3" |
Definition at line 18 of file StringUtils.hpp.
|
static |
Definition at line 29 of file StringUtils.hpp.
|
static |
Left trim a string from start (in place)
| str | string to trim from the left |
Definition at line 76 of file StringUtils.hpp.
|
static |
Left trim a string from start (copy)
| str | string to trim from the left |
Definition at line 102 of file StringUtils.hpp.
|
static |
Returns a random string of length characters.
Definition at line 191 of file StringUtils.hpp.
|
static |
Replaces a token within a string with another string
| str | String that contains tokens to replace |
| search | Token to replace |
| replace | New value to replace token with |
Definition at line 153 of file StringUtils.hpp.
|
static |
Replaces a token within a string with another string and return a new copy
| str | String that contains tokens to replace |
| search | Token to replace |
| replace | New value to replace token with |
Definition at line 168 of file StringUtils.hpp.
|
static |
Right trim a string from end (in place)
| str | string to trim from the right |
Definition at line 84 of file StringUtils.hpp.
|
static |
Right trim a string from end (copy)
| str | string to trim from the right |
Definition at line 110 of file StringUtils.hpp.
|
static |
Split a string by delimiter.
| str | String to split |
| delim | Split by delimiter |
Definition at line 37 of file StringUtils.hpp.
|
static |
Returns true if str starts with prefix.
| str | string to check |
| prefix | prefix to check if str starts with it |
| ignoreCase | Case sensitivity, default: false |
Definition at line 128 of file StringUtils.hpp.
|
static |
Convert a string to T type
| T | desired type |
| str | string to convert |
Definition at line 183 of file StringUtils.hpp.
|
static |
Lowercase original string str.
| str | string to lowercase |
Definition at line 56 of file StringUtils.hpp.
|
static |
Lowercase a string.
| str | string to lowercase |
Definition at line 49 of file StringUtils.hpp.
|
static |
Uppercase original string str.
| str | string to uppercase |
Definition at line 70 of file StringUtils.hpp.
|
static |
Uppercase a string.
| str | string to uppercase |
Definition at line 63 of file StringUtils.hpp.
|
static |
Left and right trim a string (from beginning and end) (in place)
| str | string to trim from the left and right |
Definition at line 94 of file StringUtils.hpp.
|
static |
Left and Right trim a string from start and end (copy)
| str | string to trim from the left and right |
Definition at line 118 of file StringUtils.hpp.