substring
substring(string
,begin
) substring(string
,begin
,end
)
The SUBSTRING function has the following arguments:
string
The string to extract the substring from
begin
The beginning position to start the extraction
end
(Optional) The ending position to end the extraction. The extraction will be to the character prior to the end index. If not specified the extraction will continnue to the end of the input string.
The substring function will extract a substring from the input string, starting a the begin index and continuing to the end index, or if not specified to the end of the string.
It is an error if the index values are out of range, or if the end index is less than or eqal to the begin index.
Formula |
Description |
Result |
---|---|---|
substring('abcdefg', 3) |
Extract a substring starting at character index 3 and going to the end of the string |
'defg' |
substring('abcdefg', 3, 5) | Extract a substring starting at character index 3 and going to the character prior to index position 5. | 'de' |