The Substring()
function returns a subset of a text.
Syntax
Substring(text, length)
Substring(text, start_position, length)
Returns
A new text that is a subset of text
beginning at a position through a number of characters.
Parameters
text
– a textstart_position
– (optional) the position to start from (1-based)length
– the number of charachters that are taken fromtext
Examples
Substring("Important", 6) /* "Import" */
Substring("Important", 3, 4) /* "port" */
Substring("Blueberry", 100) /* "" */
Substring("Blueberry", 5, 100) /* "berry" */
Substring("Dan: \"Thank you!\".", 6) + "Welcome\"."
/* returns "Dan: \"Welcome.\"." */