string
Library to interact with strings.
Types
std::string::NullString
std::string::NullStringA null-terminated ASCII string.
using NullString = std::string::NullStringBase;std::string::NullString16
std::string::NullString16A null-terminated UTF-16 string.
using NullString16 = std::string::NullStringBase;std::string::NullStringBase
std::string::NullStringBaseBase type for null-terminated strings. Represents a string with its size determined by the first 0x00 byte found.
<DataType>: The type of the characters.
struct NullStringBase<> { ... } [[sealed, format, transform]];std::string::SizedString
std::string::SizedStringA ASCII string with a prefixed size.
<SizeType>: The type of the size field.
using SizedString<SizeType> = std::string::SizedStringBase;std::string::SizedString16
std::string::SizedString16A UTF-16 string with a prefixed size.
<SizeType>: The type of the size field.
using SizedString16<SizeType> = std::string::SizedStringBase;std::string::SizedStringBase
std::string::SizedStringBaseBase type for sized strings. Represents a string with its size preceding it.
<SizeType>: The type of the size field.<DataType>: The type of the characters.
struct SizedStringBase<, > { ... } [[sealed, format, transform]];Functions
std::string::length
std::string::lengthGets the length of a string.
string: The string to get the length of.return: The length of the string.
fn length(str string);std::string::at
std::string::atGets the character at a given index.
string: The string to get the character from.index: The index of the character to get.return: The character at the given index.
fn at(str string, u32 index);std::string::substr
std::string::substrGets a substring of a string.
string: The string to get the substring from.pos: The position of the first character of the substring.count: The number of characters to get.return: The substring.
fn substr(str string, u32 pos, u32 count);std::string::parse_int
std::string::parse_intConverts a string to an integer.
string: The string to convert.base: The base of the number.return: The integer.
fn parse_int(str string, u8 base);std::string::parse_float
std::string::parse_floatConverts a string to a float.
string: The string to convert.return: The float.
fn parse_float(str string);std::string::to_string
std::string::to_stringConverts any type to a string.
x: The value to convert.return: The string.
fn to_string(auto x);std::string::starts_with
std::string::starts_withChecks if a string starts with a given substring.
string: The string to check.part: The substring to check for.return: True if the string starts with the substring, false otherwise.
fn starts_with(str string, str part);std::string::ends_with
std::string::ends_withChecks if a string ends with a given substring.
string: The string to check.part: The substring to check for.return: True if the string ends with the substring, false otherwise.
fn ends_with(str string, str part);std::string::contains
std::string::containsChecks if a string contains a given substring.
string: The string to check.part: The substring to check for.return: True if the string contains the substring, false otherwise.
fn contains(str string, str part);std::string::reverse
std::string::reverseReverses a string.
string: The string to reverse.return: The reversed string.
fn reverse(str string);std::string::to_upper
std::string::to_upperConverts a string to upper case.
string: The string to convert.return: The converted string.
fn to_upper(str string);std::string::to_lower
std::string::to_lowerConverts a string to lower case.
string: The string to convert.return: The converted string.
fn to_lower(str string);std::string::replace
std::string::replaceReplaces all occurrences of a substring with another substring.
string: The string to replace in.pattern: The substring to replace.replace: The substring to replace with.return: The string with the replacements.
fn replace(str string, str pattern, str replace);Last updated
Was this helpful?