Returns a substring beginning at the specified location and having the specified length.
This method is considered deprecated. Use substring instead.
substr(start, length?)
start
The starting index of the desired substring. The index of the first character in the string is zero.
length
The number of UTF-16 code units to include in the returned substring.
If omitted, returns the substring starting at startIndex until the end of the string.
A string.
"spring".substr(1, 3)
"pri"
"spring".substr(1)
"pring"