Syntax
Parameters
str: required, the string to extract characters. It must be a VARCHAR value.pos: required, an integer that specifies the starting position. Note that the first character in a string is 1, not 0.- If
posis 0, an empty string is returned. poscan be a negative integer. In this case, this function extracts characters starting from the end of the string. See Example 2.- If the position specified by
posexceeds the range of the string, an empty string is returned. See Example 3.
- If
len: optional, a positive integer that specifies the number of characters to extract.- If
lenis specified, this function extractslencharacters starting from the position specified bypos. - If
lenis not specified, this function extracts all the characters starting atpos. See Example 1. - If
lenexceeds the actual length of the matching characters, all the matching characters are returned. See Example 4.
- If
Return value
Returns a value of the VARCHAR type.Examples
Text