Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

substr

Summary

Returns a subset of a string starting at the given location through the given number of characters.

Syntax

"string".substr(start [, length])

Parameters

start

The location to start the subset of characters.
**length**
The number of characters to extract from the string.
### Example
var string = "The quick brown fox.";

print(string.substr(0, 3));     // "The"
print(string.substr(4));        // "quick brown fox."
print(string.substr(-3, 10));   // "ox."