This function or event no longer exists in version 6.0.1.18612 of World of Warcraft. Please check the main API page for an up-to-date listing of the valid API functions

Returns a substring of a string. Alias for the standard library function string.sub.


See also Lua library functions.

Signature:

s = strsub("s", firstChar [, lastChar])

Arguments:

  • s - A string (string)
  • firstChar - Position of a character in the string (can be negative to count backwards from the end of the string) (number)
  • lastChar - Position of a later character in the string (can be negative to count backwards from the end of the string); defaults to -1 if omitted (number)

Returns:

  • s - The substring of s starting at the character firstChar and ending with the character lastChar (string)
This function is defined in the Lua standard libraries