_substring
Extracts part of a Text or Large Text --
Function
Anything -> _substring
(start, end) -> Text Type
- Receives
- Anything -- each received item will be rendered as text, and then the substring taken from that.
- start
- The zero-based index of the beginning of the substring
- end (optional)
- The zero-based index of the end of the substring -- if omitted, takes the rest of the string
- Produces
- The specified chunk out of the received text
Given some text, this extracts the portion of it beginning at
character start, and running through end - 1.
The parameters are zero-indexed; that is, the first character is 0, the second 1, etc.
This function is designed to deliberately ape the substring methods familiar from languages like
Java and JavaScript, and is mainly aimed at programmers. However, it is more forgiving than Java of indexes that
are out of bounds -- in particular, if END is beyond the end of the string, it will return the value
through the end of the string, and if START is beyond the end of the string, it will always return
the empty string.