substring()

The substring() function returns a substring of a string.

Syntax

substring(expr1, expr2, [expr3])
Note:
  1. expr1 (a string) is the name of the string from which to extract the substring.
  2. expr2 (a number) is the start index position. The first character in the string has an index of zero.
  3. expr3 (a number) is the length (size) of the string to extract. If omitted, the substring ends at the end of the string.

Example

substring('0123456789',2,4)          

Returns 2345