Base class: Object, std::wstring
This class provides an interface for manipulating wide unicode text strings. This class is preferable because it can support all characters.
Property | Type | Description |
---|---|---|
WString | Constructor | WString(c: string) |
WString | Constructor | WString(c: string) |
WString | Constructor | WString(i: number) |
WString | Constructor | WString(f: number) |
WString | Constructor | WString(f: number) |
Find | Method | performs a search operation |
GetSize | Method | returns the length of the string |
Left | Method | returns leftmost characters |
Lower | Method | converts the string to lowercase |
Mid | Method | returns the length of the string |
Replace | Method | performs a search and replace operation |
Right | Method | returns rightmost characters |
Split | Method | segments the string |
StartsWith | Method | compares the beginning of two strings |
ToFloat | Method | converts the string to a floating point value |
ToInt | Method | converts the string to an integer value |
ToString | Method | returns a narrow string containing only ASCII characters |
ToUtf8String | Method | returns a narrow string with UTF-8 encoding |
Trim | Method | removes whitespace characters from the ends of the string |
Upper | Method | converts the string to uppercase |
Xor | Method | performs an XOR operation |
Example:
-- Create a new WString
local str = WString("Hello, Lua!")
-- Get the length of the string
local size = str:GetSize()
-- Convert the string to uppercase
str:Upper()
-- Print the modified string
print(str:ToString())