|
Public Member Functions |
| | otString () |
| | otString (const char *chr) |
| bool | create (const char *chr) |
| U32 | size () |
| | Returns the number of characters in this string. The last character in the string is at position size() - 1.
|
| void | set (const char *chr) |
| | Init the class already allocated with a new string.
|
| void | close () |
| | Free the memory of the allocated data.
|
| const char * | cstr () |
| | Return the C string pointer.
|
| bool | append (const char c) |
| | Append specified the specified character.
|
| bool | append (const char *c) |
| | Append specified the specified string.
|
| bool | append (otString &app_str) |
| | Append specified the contents of the specified class.
|
| bool | replace (U32 index, const char new_char) |
| | Replace the character at the specified position.
|
| U32 | replace (const char old_char, const char new_char) |
| | Replace all characters specified with a new one.
|
| int | indexOf (const char *str_find, U32 initial_position=0) |
| | Returns the index position of the last occurrence of the string str in this string, searching backward from index position from.
|
| int | indexOf (otString &str_find, U32 initial_position=0) |
| | Returns the index position of the last occurrence of the string str in this string, searching backward from index position from.
|
| bool | contains (const char *str_find) |
| | Returns true if this string contains an occurrence of the string str; otherwise returns false.
|
| bool | contains (otString &str_find) |
| | Returns true if this string contains an occurrence of the string str; otherwise returns false.
|
| int | compare (otString &str) |
| | Compare with another string.
|
| int | compare (const char *str) |
| | Compare with another string.
|
| bool | chop () |
| | Removes a character from the end of the string.
|
| void | toLower () |
| | Convert to lowercase the string.
|
| void | toUpper () |
| | Convert to uppercase the string.
|
| bool | startsWith (const char *txt) |
| | Returns true if the string starts with txt; otherwise returns false.
|
| bool | startsWith (otString &txt) |
| | Returns true if the string starts with txt; otherwise returns false.
|
| bool | endsWith (const char *txt) |
| | Returns true if the string ends with txt; otherwise returns false.
|
| bool | endsWith (otString &txt) |
| | Returns true if the string ends with txt; otherwise returns false.
|
| bool | insert (U32 pos, const char *txt) |
| | Insert a string at the specified position.
|
| bool | insert (U32 pos, otString &txt) |
| | Insert a string at the specified position.
|
| otString | left (U32 n) |
| | Returns a substring that contains the n leftmost characters of the string.
|
| otString | right (U32 n) |
| | Returns a substring that contains the n rightmost characters of the string.
|
| otString | mid (U32 position, int n=-1) |
| | Returns a string that contains n characters of this string, starting at the specified position index.
|
| U32 | simplified () |
| | Returns a string that has whitespace removed from the start and the end, and that has each sequence of internal whitespace replaced with a single space. This includes the ASCII characters '\t', '\n', '\v', '\f', '\r', and ' '.
|
| bool | isEmpty () |
| | Returns true if the string has no characters; otherwise returns false.
|
| S32 | toInt (int base) |
| | Returns the string converted to an int using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails. If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.
|
| U32 | toUInt (int base) |
| | Returns the string converted to an unsigned int using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails. If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.
|
| S64 | toLongLong (int base) |
| | Returns the string converted to an unsigned long long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails. If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.
|
| U64 | toULongLong (int base) |
| | Returns the string converted to a long long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails. If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.
|
| otStringList | split (const char *sep) |
| | Splits the string into substrings wherever sep occurs, and returns the list of those strings. If sep does not match anywhere in the string, split() returns a single-element list containing this string.
|
| otStringList | split (otString &sep) |
| | Splits the string into substrings wherever sep occurs, and returns the list of those strings. If sep does not match anywhere in the string, split() returns a single-element list containing this string.
|