Skip to main content

string.sub

Returns a substring of str starting at s and ending at e. Use negative numbers to start from the end of the string.

string.sub(str: string, s: number, e: number): string

Arguments

NameDescriptionType
strString to get the substring of.string
sWhere to start the substring, inclusive. Defaults to 1.number
eWhere to end the substring. Defaults to -1 (end of the string).number

Returns string