Documentation

string

Class

The string class used in Openplanet as well as the game.

Methods

int opCmp(const string&in) const
Operator obj > x, obj < x, etc.
Returns int
uint8& opIndex(uint)
Operator obj[x]
Returns uint8
const uint8& opIndex(uint) const
Operator obj[x]
Returns uint8
string& opAssign(const string&in)
Operator obj = x
Returns string
string& opAddAssign(const string&in)
Operator obj += x
Returns string
string opAdd(const string&in) const
Operator obj + x
Returns string
string opAdd(const wstring&in) const
Operator obj + x
Returns string
string opAdd(int64) const
Operator obj + x
Returns string
string opAdd_r(int64) const
Operator x + obj
Returns string
string opAdd(uint64) const
Operator obj + x
Returns string
string opAdd_r(uint64) const
Operator x + obj
Returns string
string opAdd(float) const
Operator obj + x
Returns string
string opAdd_r(float) const
Operator x + obj
Returns string
string opAdd(bool) const
Operator obj + x
Returns string
string opAdd_r(bool) const
Operator x + obj
Returns string
wstring opImplConv() const
Operator wstring x = obj
Returns wstring
bool StartsWith(const string&in) const

Returns true if the string starts with the given substring.

Returns bool
bool EndsWith(const string&in) const

Returns true if the string ends with the given substring.

Returns bool
bool Contains(const string&in) const

Returns true if the string contains the given substring.

Returns bool
int LastIndexOf(const string&in) const

Searches the string for the given substring and returns the index at which the last instance of it starts. When it is not found, returns -1.

Returns int
int IndexOf(const string&in) const

Searches the string for the given substring and returns the index at which it starts. When it is not found, returns -1.

Returns int
int IndexOfI(const string&in) const

Same as IndexOf, but case insensitive.

Returns int
int get_Length() const
Property obj.Length

The length of the string in bytes.

Returns int
string Trim() const

Returns a string from this string with whitespace at the start and end of the string removed. Whitespace includes spaces, tabs, newlines, vertical tabs, feeds, and carriage returns.

Returns string
string ToLower() const

Returns a string from this string with all characters in lowercase.

Returns string
string ToUpper() const

Returns a string from this string with all characters in uppercase.

Returns string
string SubStr(int index) const

Returns the remainder of the string after the given index. For example; for the string "Hello", SubStr(1) returns "ello".

Returns string
string SubStr(int index, int length) const

Returns a portion of the string from the index and length. For example; for the string "Hello", SubStr(1, 3) returns "ell".

Returns string
string Replace(const string&in search, const string&in replace) const

Returns the string with all the given search substrings replaced with the given replacement string.

Returns string
string[]@ Split(const string&in str, int limit = 0) const

Splits the string on the given substring and returns an array with all the individual parts.

Returns string[]@