|
static const bool | startsWith (const string &str, const string &prefix) |
| Checks if string starts with prefix. More...
|
|
static const bool | viewStartsWith (const string_view &str, const string_view &prefix) |
| Checks if string starts with prefix. More...
|
|
static const bool | endsWith (const string &str, const string &suffix) |
| Checks if string ends with suffix. More...
|
|
static const bool | viewEndsWith (const string_view &str, const string_view &suffix) |
| Checks if string ends with suffix. More...
|
|
static const string | replace (const string &str, const string &what, const string &by, int64_t beginIndex=0, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *cache=nullptr) |
| Replace string with another string. More...
|
|
static int64_t | indexOf (const string &str, const string &what, int64_t beginIndex=0, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *cache=nullptr) |
| Finds first index of given string. More...
|
|
static int64_t | firstIndexOf (const string &str, const string &what, int64_t beginIndex=0, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *cache=nullptr) |
| Finds first index of given string. More...
|
|
static int64_t | lastIndexOf (const string &str, const string &what, int64_t endIndex=string::npos, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *cache=nullptr) |
| Finds last index of given string. More...
|
|
static int64_t | firstIndexOfChars (const string &str, const string &what, int64_t beginIndex=0, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *srcCache=nullptr, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *whatCache=nullptr) |
| Finds first index of characters provided within given string. More...
|
|
static int64_t | lastIndexOfChars (const string &str, const string &what, int64_t endIndex=string::npos, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *srcCache=nullptr, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *whatCache=nullptr) |
| Finds last index of characters provided within given string. More...
|
|
static const string | substring (const string &str, int64_t beginIndex, int64_t endIndex=string::npos, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *srcCache=nullptr, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *cache=nullptr) |
| Returns substring of given string from begin index to end index. More...
|
|
static const string_view | viewSubstring (const string_view &str, int64_t beginIndex, int64_t endIndex, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *cache=nullptr) |
| Returns substring of given string from begin index to end index. More...
|
|
static bool | equalsIgnoreCase (const string &string1, const string &string2, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *string1Cache=nullptr, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *string2Cache=nullptr) |
| Checks if strings equal ignoring case. More...
|
|
static const string | trim (const string &str, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *cache=nullptr) |
| Trim string. More...
|
|
static const string_view | viewTrim (const string_view &str, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *cache=nullptr) |
| Trim string. More...
|
|
static const string | toLowerCase (const string &str, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *cache=nullptr) |
| Transform string to lower case. More...
|
|
static const string | toUpperCase (const string &str, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *cache=nullptr) |
| Transform string to upper case. More...
|
|
static bool | regexMatch (const string &str, const string &pattern, smatch *matches=nullptr) |
| Check if pattern matches whole string. More...
|
|
static bool | regexSearch (const string &str, const string &pattern, smatch *matches=nullptr) |
| Do regex pattern search. More...
|
|
static const string | regexReplace (const string &str, const string &pattern, const string &by) |
| Replace regex pattern with given string. More...
|
|
static const vector< string > | tokenize (const string &str, const string &delimiters, bool emptyTokens=false) |
| Tokenize. More...
|
|
static const string | padLeft (const string &str, const string &by, int64_t toLength, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *cache=nullptr) |
| Pad a string left. More...
|
|
static const string | padRight (const string &str, const string &by, int64_t toLength, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *cache=nullptr) |
| Pad a string right. More...
|
|
static const string | indent (const string &str, const string &with, int64_t count) |
| Indent a string. More...
|
|
static const string | generate (const string &what, int64_t count=1) |
| Generate a string. More...
|
|
static int64_t | getLength (const string &str, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *cache=nullptr) |
| Get UTF8 string length. More...
|
|
static const string | getCharAt (const string &str, int64_t index, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *cache=nullptr) |
| Get UTF8 character at given index. More...
|
|
static uint32_t | getCodePointAt (const string &str, int64_t index, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *cache=nullptr) |
| Get UTF8 code point at given index. More...
|
|
static int64_t | getUTF8BinaryIndex (const string &str, int64_t charIdx, ::minitscript::utilities::UTF8CharacterIterator::UTF8PositionCache *cache=nullptr) |
| Get UTF8 binary buffer index. More...
|
|
UTF8 String tools class.
- Author
- Andreas Drewke
Definition at line 21 of file UTF8StringTools.h.