string

String type

Type: Value type

Methods

Declaration Description
void string() Constructor
void string(const string& in szString) Copy constructor
void string(double flValue) Construct a string from a double.
void string(int64 iValue) Construct a string from a 64 bit integer.
void string(uint64 uiValue) Construct a string from a 64 bit unsigned integer.
void string(bool bValue) Construct a string from a boolean.
void string(char character) Construct a string from a char.
string& Assign(const string& in szString, uint uiBegin, uint uiCount) Assigns a string to this, copying up to uiCount characters.
string& opAssign(const string& in szString) Assigns a string to this one.
string& opAssign(double flValue) Assigns a double to this string.
string& opAssign(int64 iValue) Assigns a 64 bit integer to this string.
string& opAssign(uint64 uiValue) Assigns a 64 bit unsigned int to this string.
string& opAssign(bool bValue) Assigns a boolean to this string.
string& opAssign(char character) Assigns a character to this string.
uint Length() const Gets the length of this string.
bool IsEmpty() const Returns whether this string is empty.
void Resize(uint uiSize, bool bKeepData = true) Shrinks this string to uiSize. If bKeepData is true, the original string is kept.
void Reserve(uint iMinimum, bool bKeepData = true) Reserves at least iMinimum characters worth of capacity. If bKeepData is true, the original string is kept.
void Clear() Clears the contents of this string.
char opIndex(uint uiIndex) const Gets a character by index.
void SetCharAt(uint uiIndex, char character) Sets a character by index.
string& opAddAssign(const string& in szString) Appends the given string to this one.
string& opAddAssign(double flValue) Appends the given double to this string.
string& opAddAssign(int64 iValue) Appends the given 64 bit integer to this string.
string& opAddAssign(uint64 uiValue) Appends the given 64 bit unsigned integer to this string.
string& opAddAssign(bool bValue) Appends the given boolean to this string.
string& opAddAssign(char character) Appends the given character to this string.
int opCmp(const string& in szString) const Compares strings.
int Compare(const string& in szString) const Compares strings.
int CompareN(const string& in szString, const uint amount) const Compares strings up to amount characters.
int ICompare(const string& in szString) const Compares strings case-insensitively.
int ICompareN(const string& in szString, const uint amount) const Compares strings up to amount characters case-insensitively.
bool opEquals(const string& in szString) const Returns whether strings are equal.
void Trim(const string& in szCharacter = ' ') Trims leading and trailing whitespace, or a given character.
bool StartsWith(const string& in szString, const String::CompareType compareType = String::DEFAULT_COMPARE) const Returns true if the string starts with the given string.
bool EndsWith(const string& in szString, const String::CompareType compareType = String::DEFAULT_COMPARE) const Returns true if the string ends with the given string.
uint Find(const string& in szString, const uint startIndex = 0, const String::CompareType compareType = String::DEFAULT_COMPARE) const Find the first instance of the given string.
Returns String::INVALID_INDEX if not found.
uint RFind(const string& in szString, uint startIndex = String::INVALID_INDEX, const String::CompareType compareType = String::DEFAULT_COMPARE) const Find the first instance of the given string, searching in reverse.
Returns String::INVALID_INDEX if not found.
uint FindFirstOf(const string& in szString, const uint startIndex = 0, const String::CompareType compareType = String::DEFAULT_COMPARE) const Find the first instance of any character in the given string.
Returns String::INVALID_INDEX if not found.
uint FindLastOf(const string& in szString, const uint startIndex = 0, const String::CompareType compareType = String::DEFAULT_COMPARE) const Find the last instance of any character in the given string.
Returns String::INVALID_INDEX if not found.
uint FindFirstNotOf(const string& in szString, uint startIndex = 0, const String::CompareType compareType = String::DEFAULT_COMPARE) const Find the first instance of the given string.
Returns String::INVALID_INDEX if not found.
uint FindLastNotOf(const string& in szString, uint startIndex = String::INVALID_INDEX, const String::CompareType compareType = String::DEFAULT_COMPARE) const Find the first instance of the given string, searching in reverse.
Returns String::INVALID_INDEX if not found.
string Tokenize(const string& in delimiter) const Get the next token of the given string.
Returns String::NO_MORE_TOKENS if none remaining.
string& ToLowercase() Converts this string to lower case.
string& ToUppercase() Converts this string to upper case.
string SubString(uint startIndex = 0, uint count = String::INVALID_INDEX) const Returns a substring of this string.
string& Replace(const string& in szSubstring, const string& in szReplacement, const String::CompareType compareType = String::DEFAULT_COMPARE) Replaces the given substring with the given replacement string.
void Truncate(const size_t uiMaxLength) Truncates the string to uiMaxLength characters.
string opAdd(const string& in szString) const Returns a copy of this string with the given string appended.
string opAdd(double flValue) const Returns a copy of this string with the given double appended.
string opAdd(int64 iValue) const Returns a copy of this string with the given 64 bit integer appended.
string opAdd(uint64 uiValue) const Returns a copy of this string with the given 64 bit unsigned integer appended.
string opAdd(bool bValue) const Returns a copy of this string with the given boolean appended.
string opAdd(char character) const Returns a copy of this string with the given character appended.
array<string>@ Split(const string& in szDelimiter) const Splits this string by the given delimiter.