|
tgbotxx 1.1.9.2
Telegram Bot C++ Library
|
#include <algorithm>#include <random>#include <span>#include <sstream>#include <string>#include <vector>Go to the source code of this file.
Namespaces | |
| namespace | tgbotxx |
| namespace | tgbotxx::StringUtils |
| Namespace contains useful string related utility functions. | |
Functions | |
| template<typename T , typename D > | |
| static std::string | tgbotxx::StringUtils::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 | tgbotxx::StringUtils::join (const std::vector< T > &con, const D &delim) |
| static std::vector< std::string > | tgbotxx::StringUtils::split (const std::string &str, char delim) |
| Split a string by delimiter. | |
| static std::string | tgbotxx::StringUtils::toLowerCopy (std::string str) |
| Lowercase a string. | |
| static void | tgbotxx::StringUtils::toLower (std::string &str) |
| Lowercase original string str. | |
| static std::string | tgbotxx::StringUtils::toUpperCopy (std::string str) |
| Uppercase a string. | |
| static void | tgbotxx::StringUtils::toUpper (std::string &str) |
| Uppercase original string str. | |
| static void | tgbotxx::StringUtils::ltrim (std::string &str) |
| Left trim a string from start (in place) | |
| static void | tgbotxx::StringUtils::rtrim (std::string &str) |
| Right trim a string from end (in place) | |
| static void | tgbotxx::StringUtils::trim (std::string &str) |
| Left and right trim a string (from beginning and end) (in place) | |
| static std::string | tgbotxx::StringUtils::ltrimCopy (std::string s) |
| Left trim a string from start (copy) | |
| static std::string | tgbotxx::StringUtils::rtrimCopy (std::string s) |
| Right trim a string from end (copy) | |
| static std::string | tgbotxx::StringUtils::trimCopy (std::string s) |
| Left and Right trim a string from start and end (copy) | |
| static bool | tgbotxx::StringUtils::startsWith (const std::string &str, const std::string &prefix, bool ignoreCase=false) |
| Returns true if str starts with prefix. | |
| static bool | tgbotxx::StringUtils::endsWith (const std::string &str, const std::string &suffix, bool ignoreCase=false) |
| Returns true if str ends with suffix. | |
| static void | tgbotxx::StringUtils::replace (std::string &str, const std::string &search, const std::string &replace) |
| static std::string | tgbotxx::StringUtils::replaceCopy (std::string str, const std::string &search, const std::string &replace) |
| template<typename T > | |
| static T | tgbotxx::StringUtils::to (const std::string &str) |
| static std::string | tgbotxx::StringUtils::random (std::size_t length) |
| Returns a random string of length characters. | |