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 StringAnsi class.
Declaration
public StringAnsi(const Char* str)
Parameters
|
Char
str
ANSI string |
StringAnsi(const char* str)
Initializes a new instance of the StringAnsi class.
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 StringAnsi class.
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 StringAnsi class.
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 StringAnsi class.
Declaration
public StringAnsi(const String& str)
Parameters
|
String
str
The reference to the string. |
StringAnsi(const StringAnsi& str)
Initializes a new instance of the StringAnsi class.
Declaration
public StringAnsi(const StringAnsi& str)
Parameters
|
StringAnsi
str
The reference to the string. |
StringAnsi(const StringAnsiView& str)
Initializes a new instance of the StringAnsi class.
Declaration
public StringAnsi(const StringAnsiView& str)
Parameters
|
StringAnsiView
str
The other string. |
StringAnsi(const StringView& str)
Initializes a new instance of the StringAnsi class.
Declaration
public StringAnsi(const StringView& str)
Parameters
|
StringView
str
The other string. |
StringAnsi(StringAnsi&& str)
Initializes a new instance of the StringAnsi class.
Declaration
public StringAnsi(StringAnsi&& str) noexcept
Parameters
|
StringAnsi
str
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
|
StringAnsi
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
|
StringAnsi
text
The text to append. |
Returns
|
StringAnsi
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
|
StringAnsiView
suffix
|
|
StringSearchCase
searchCase
|
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
|
StringAnsi
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. |
|
StringAnsi
other
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
|
StringAnsi
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
|
StringAnsi
other
|
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
|
StringAnsi
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
|
StringAnsi
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
|
StringAnsi
The reference to this string. |
operator+=(const StringAnsi& str)
Appends the specified text to this string.
Declaration
public StringAnsi operator+=(const StringAnsi& str)
Parameters
|
StringAnsi
str
The text to append. |
Returns
|
StringAnsi
The reference to this string. |
operator+=(const StringAnsiView& str)
Appends the specified text to this string.
Declaration
public StringAnsi operator+=(const StringAnsiView& str)
Parameters
|
StringAnsiView
str
The text to append. |
Returns
|
StringAnsi
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
|
StringAnsi
other
|
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
|
StringAnsi
other
|
Returns
|
bool
|
operator=(const char c)
Sets the text value.
Declaration
public StringAnsi operator=(const char c)
Parameters
|
char
c
The other character. |
Returns
|
StringAnsi
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
|
StringAnsi
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
|
StringAnsi
The reference to this. |
operator=(const StringAnsi& s)
Sets the text value.
Declaration
public StringAnsi operator=(const StringAnsi& s)
Parameters
|
StringAnsi
s
The other string. |
Returns
|
StringAnsi
The reference to this. |
operator=(const StringAnsiView& s)
Sets the text value.
Declaration
public StringAnsi operator=(const StringAnsiView& s)
Parameters
|
StringAnsiView
s
The other string. |
Returns
|
StringAnsi
The reference to this. |
operator=(StringAnsi&& s)
Sets the text value.
Declaration
public StringAnsi operator=(StringAnsi&& s) noexcept
Parameters
|
StringAnsi
s
The other string. |
Returns
|
StringAnsi
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
|
StringAnsi
other
|
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
|
StringAnsi
other
|
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
|
StringAnsi
other
|
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
|
StringAnsi
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
|
StringAnsiView
prefix
|
|
StringSearchCase
searchCase
|
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
|
StringAnsi
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
|
StringAnsi
The substring created from String data. |
ToLower()
Converts all uppercase characters to lowercase.
Declaration
public StringAnsi ToLower() const
Returns
|
StringAnsi
The lowercase string. |
ToString()
ToStringAnsi()
ToUpper()
Converts all lowercase characters to uppercase.
Declaration
public StringAnsi ToUpper() const
Returns
|
StringAnsi
The uppercase string. |