SubString

Parameters
source string

Text string.

start integer

Starting position, zero-indexed, inclusive.

end integer

Last position, zero-indexed, exclusive.

comment

Returns a new substring from the interval [start, end) - inclusive, exclusive. Positions are zero-indexed. For empty or invalid out-of-bounds values returns an empty string "" (in Lua).

For start>end returns substring beginning with start until the actual end of string. For start<0 returns an empty string.

Examples (Lua):

SubString("abc", 0, 0) == ""
SubString("abc", 0, 1) == "a"
SubString("abc", 2, 3) == "c"
SubString("abc", 0, 3) == "abc"
SubString("abcdef", 2, 0) == "cdef"
pure
This function is pure. For the same values passed to it, it will always return the same value.
return type
string
Source code
native SubString takes string source, integer start, integer end returns string
Source
string.j
wc3modding.com
SubString