tgbot-cpp
|
Functions | |
bool | startsWith (const std::string &str1, const std::string &str2) |
bool | endsWith (const std::string &str1, const std::string &str2) |
void | split (const std::string &str, char delimiter, std::vector< std::string > &dest) |
std::string | generateRandomString (size_t length) |
std::string | urlEncode (const std::string &value, const std::string &additionalLegitChars="") |
std::string | urlDecode (const std::string &value) |
std::vector< std::string > | split (const std::string &str, char delimiter) |
bool StringTools::endsWith | ( | const std::string & | str1, |
const std::string & | str2 | ||
) |
Checks if first string is ending with second string
str1 | First string |
str2 | Second string |
std::string StringTools::generateRandomString | ( | size_t | length | ) |
Generates pseudo random string. It's recommended to call srand before this method.
length | Length of resulting string. |
void StringTools::split | ( | const std::string & | str, |
char | delimiter, | ||
std::vector< std::string > & | dest | ||
) |
Splits string to smaller substrings which have between them a delimiter. Resulting substrings won't have delimiter.
str | Source string |
delimiter | Delimiter |
dest | Array to which substrings will be saved. |
|
inline |
Splits string to smaller substrings which have between them a delimiter. Resulting substrings won't have delimiter.
str | Source string |
delimiter | Delimiter |
Definition at line 84 of file StringTools.h.
bool StringTools::startsWith | ( | const std::string & | str1, |
const std::string & | str2 | ||
) |
Checks if first string is starting with second string
str1 | First string |
str2 | Second string |
std::string StringTools::urlDecode | ( | const std::string & | value | ) |
Performs url decode.
value | Encoded url string |
std::string StringTools::urlEncode | ( | const std::string & | value, |
const std::string & | additionalLegitChars = "" |
||
) |
Performs url encode.
value | Source url string |
additionalLegitChars | Optional. String of chars which will be not encoded in source url string. |