Class StringAnsi
Represents text as a sequence of ANSI characters. Container uses a single dynamic memory allocation to store the characters data. Characters sequence is always null-terminated.
Inheritance
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Core/Types/String.h
Syntax
public class StringAnsi : public StringBase
Constructors
StringAnsi()
StringAnsi(const Char* str)
Initializes a new instance of the String
Declaration
public StringAnsi(const Char* str)
Parameters
Char
str
ANSI string |
StringAnsi(const char* str)
Initializes a new instance of the String
Declaration
public StringAnsi(const char* str)
Parameters
char
str
The UTF-16 string. |
StringAnsi(const char* str, int32 length)
Initializes a new instance of the String
Declaration
public StringAnsi(const char* str, int32 length)
Parameters
char
str
The ANSI string. |
int32
length
The ANSI string length. |
StringAnsi(const Char* str, int32 length)
Initializes a new instance of the String
Declaration
public StringAnsi(const Char* str, int32 length)
Parameters
Char
str
The UTF-16 string. |
int32
length
The UTF-16 string length. |
StringAnsi(const String& str)
Initializes a new instance of the String
Declaration
public StringAnsi(const String& str)
Parameters
String
str
The reference to the string. |
StringAnsi(const StringAnsi& str)
Initializes a new instance of the String
Declaration
public StringAnsi(const StringAnsi& str)
Parameters
String The reference to the string. |
StringAnsi(const StringAnsiView& str)
Initializes a new instance of the String
Declaration
public StringAnsi(const StringAnsiView& str)
Parameters
String The other string. |
StringAnsi(const StringView& str)
Initializes a new instance of the String
Declaration
public StringAnsi(const StringView& str)
Parameters
String The other string. |
StringAnsi(StringAnsi&& str)
Initializes a new instance of the String
Declaration
public StringAnsi(StringAnsi&& str) noexcept
Parameters
String The double reference to the string. |
Fields
Empty
Methods
Append(const char c)
Appends the specified character to this string.
Declaration
public StringAnsi Append(const char c)
Parameters
char
c
The character to append. |
Returns
String The reference to this string. |
Append(const char* chars, int32 count)
Appends an array of characters to the string.
Declaration
public void Append(const char* chars, int32 count)
Parameters
char
chars
The array of characters to append. It does not need be null-terminated, and null characters are not treated specially. |
int32
count
The number of characters to append. |
Append(const Char* chars, int32 count)
Appends an array of characters to the string.
Declaration
public void Append(const Char* chars, int32 count)
Parameters
Char
chars
The array of characters to append. It does not need be null-terminated, and null characters are not treated specially. |
int32
count
The number of characters to append. |
Append(const StringAnsi& text)
Appends the specified text to this string.
Declaration
public StringAnsi Append(const StringAnsi& text)
Parameters
String The text to append. |
Returns
String The reference to this string. |
EndsWith(const StringAnsiView& suffix, StringSearchCase searchCase=StringSearchCase::CaseSensitive)
Declaration
public bool EndsWith(const StringAnsiView& suffix, StringSearchCase searchCase=StringSearchCase::CaseSensitive) const
Parameters
String
|
String
|
Returns
bool
|
Format(const char* format, const Args& ... args)
Formats the message and gets it as a string.
Declaration
public static StringAnsi Format(const char* format, const Args& ... args)
Parameters
char
format
The format string. |
Args...
args
The custom arguments. |
Returns
String The formatted text. |
Type Parameters
Args
|
Insert(int32 startIndex, const StringAnsi& other)
Inserts string into current string instance at given location.
Declaration
public void Insert(int32 startIndex, const StringAnsi& other)
Parameters
int32
startIndex
The index of the first character to insert. |
String The string to insert. |
Left(int32 count)
Gets the left most given number of characters.
Declaration
public StringAnsi Left(int32 count) const
Parameters
int32
count
The characters count. |
Returns
String The substring. |
operator!=(const char* other)
Declaration
public bool operator!=(const char* other) const
Parameters
char
other
|
Returns
bool
|
operator!=(const StringAnsi& other)
Declaration
public bool operator!=(const StringAnsi& other) const
Parameters
String
|
Returns
bool
|
operator+=(const char c)
Appends the specified character to this string.
Declaration
public StringAnsi operator+=(const char c)
Parameters
char
c
The character to append. |
Returns
String The reference to this string. |
operator+=(const char* str)
Appends the specified text to this string.
Declaration
public StringAnsi operator+=(const char* str)
Parameters
char
str
The text to append. |
Returns
String The reference to this string. |
operator+=(const Char* str)
Appends the specified text to this string.
Declaration
public StringAnsi operator+=(const Char* str)
Parameters
Char
str
The text to append. |
Returns
String The reference to this string. |
operator+=(const StringAnsi& str)
Appends the specified text to this string.
Declaration
public StringAnsi operator+=(const StringAnsi& str)
Parameters
String The text to append. |
Returns
String The reference to this string. |
operator+=(const StringAnsiView& str)
Appends the specified text to this string.
Declaration
public StringAnsi operator+=(const StringAnsiView& str)
Parameters
String The text to append. |
Returns
String The reference to this string. |
operator<(const char* other)
Declaration
public bool operator<(const char* other) const
Parameters
char
other
|
Returns
bool
|
operator<(const StringAnsi& other)
Declaration
public bool operator<(const StringAnsi& other) const
Parameters
String
|
Returns
bool
|
operator<=(const char* other)
Declaration
public bool operator<=(const char* other) const
Parameters
char
other
|
Returns
bool
|
operator<=(const StringAnsi& other)
Declaration
public bool operator<=(const StringAnsi& other) const
Parameters
String
|
Returns
bool
|
operator=(const char c)
Sets the text value.
Declaration
public StringAnsi operator=(const char c)
Parameters
char
c
The other character. |
Returns
String The reference to this. |
operator=(const char* str)
Sets the text value.
Declaration
public StringAnsi operator=(const char* str)
Parameters
char
str
The other string. |
Returns
String The reference to this. |
operator=(const Char* str)
Sets the text value.
Declaration
public StringAnsi operator=(const Char* str)
Parameters
Char
str
The other string. |
Returns
String The reference to this. |
operator=(const StringAnsi& s)
Sets the text value.
Declaration
public StringAnsi operator=(const StringAnsi& s)
Parameters
String The other string. |
Returns
String The reference to this. |
operator=(const StringAnsiView& s)
Sets the text value.
Declaration
public StringAnsi operator=(const StringAnsiView& s)
Parameters
String The other string. |
Returns
String The reference to this. |
operator=(StringAnsi&& s)
Sets the text value.
Declaration
public StringAnsi operator=(StringAnsi&& s) noexcept
Parameters
String The other string. |
Returns
String The reference to this. |
operator==(const char* other)
Declaration
public bool operator==(const char* other) const
Parameters
char
other
|
Returns
bool
|
operator==(const StringAnsi& other)
Declaration
public bool operator==(const StringAnsi& other) const
Parameters
String
|
Returns
bool
|
operator>(const char* other)
Declaration
public bool operator>(const char* other) const
Parameters
char
other
|
Returns
bool
|
operator>(const StringAnsi& other)
Declaration
public bool operator>(const StringAnsi& other) const
Parameters
String
|
Returns
bool
|
operator>=(const char* other)
Declaration
public bool operator>=(const char* other) const
Parameters
char
other
|
Returns
bool
|
operator>=(const StringAnsi& other)
Declaration
public bool operator>=(const StringAnsi& other) const
Parameters
String
|
Returns
bool
|
Remove(int32 startIndex, int32 length)
Removes characters from the string at given location and length.
Declaration
public void Remove(int32 startIndex, int32 length)
Parameters
int32
startIndex
The index of the first character to remove. |
int32
length
The amount of characters to remove. |
Right(int32 count)
Gets the string of characters from the right (end of the string).
Declaration
public StringAnsi Right(int32 count) const
Parameters
int32
count
The characters count. |
Returns
String The substring. |
Set(const char* chars, int32 length)
Sets an array of characters to the string.
Declaration
public void Set(const char* chars, int32 length)
Parameters
char
chars
The pointer to the start of an array of characters to set (ANSI). This array need not be null-terminated, and null characters are not treated specially. |
int32
length
The number of characters to assign. |
Set(const Char* chars, int32 length)
Sets an array of characters to the string.
Declaration
public void Set(const Char* chars, int32 length)
Parameters
Char
chars
The pointer to the start of an array of characters to set (UTF-16). This array need not be null-terminated, and null characters are not treated specially. |
int32
length
The number of characters to assign. |
Split(char c, Array<StringAnsi, HeapAllocation>& results)
Splits a string into substrings that are based on the character.
Declaration
public void Split(char c, Array<StringAnsi, HeapAllocation>& results) const
Parameters
char
c
A character that delimits the substrings in this string. |
Array<StringAnsi, HeapAllocation>
results
An array whose elements contain the substrings from this instance that are delimited by separator. |
StartsWith(const StringAnsiView& prefix, StringSearchCase searchCase=StringSearchCase::CaseSensitive)
Declaration
public bool StartsWith(const StringAnsiView& prefix, StringSearchCase searchCase=StringSearchCase::CaseSensitive) const
Parameters
String
|
String
|
Returns
bool
|
Substring(int32 startIndex)
Retrieves substring created from characters starting from startIndex to the String end.
Declaration
public StringAnsi Substring(int32 startIndex) const
Parameters
int32
startIndex
The index of the first character to subtract. |
Returns
String The substring created from String data. |
Substring(int32 startIndex, int32 count)
Retrieves substring created from characters starting from start index.
Declaration
public StringAnsi Substring(int32 startIndex, int32 count) const
Parameters
int32
startIndex
The index of the first character to subtract. |
int32
count
The amount of characters to retrieve. |
Returns
String The substring created from String data. |
ToLower()
Converts all uppercase characters to lowercase.
Declaration
public StringAnsi ToLower() const
Returns
String The lowercase string. |
ToString()
ToStringAnsi()
ToUpper()
Converts all lowercase characters to uppercase.
Declaration
public StringAnsi ToUpper() const
Returns
String The uppercase string. |