nanos world API Reference Unofficial documentation
Function Shared Native

string.sub

Returns the substring of the string that starts at <code>i</code> and continues until <code>j</code>.

Syntax

Lua
string.sub(string, StartPos, EndPos)

Parameters

Name Type Default Description
string string The string you'll take a sub-string out of.
StartPos number The position of the first character that will be included in the sub-string.
EndPos number The position of the last character to be included in the sub-string. It can be negative to count from the end.

Returns

  • string