Name
substring, substr — returns a substring of a string
Synopsis
substring(
|
str string, |
| from integer, | |
sublen integer); |
substr(
|
str string, |
| from integer, | |
sublen integer); |
Description
Returns a substring of string str. The start index is 1 based. The
substring is sublen characters long. The sublen
argument is optional; when omitted, the substring extends to the end of
str.
This function follows SQL 92.
substring('AbracadabrA',1,4) -> 'Abra'
substring('AbracadabrA',5,4) -> 'cada'
substring('AbracadabrA',8,4) -> 'abrA'
substring('AbracadabrA',5) -> 'cadabrA'
substr is an alias of substring
and behaves identically.