$$substring
Gets a slice of a string by indices (negative begin index will slice from the end)
Usage​
{
"$$substring": /* String to slice */,
"begin": /* integer */,
"end": /* integer */
}
"$$substring(<begin>,[end]):{input}"
Returns​
string
Arguments​
Argument | Type | Values | Required / Default Value | Description |
---|---|---|---|---|
Primary | string | Yes | String to slice | |
begin | integer | Yes | Index of first character to slice from (if negative, counts from the end of the string) | |
end | integer | null | Index of last character to slice to (if negative, counts from the end of the string) |
Examples​
Input
Definition
Output
"hello-world"
"$$substring:$"
"hello-world"
"hello-world"
"$$substring():$"
"hello-world"
"hello-world"
"$$substring(5):$"
"-world"
"hello-world"
"$$substring(5,8):$"
"-wo"
"hello-world"
"$$substring(-5):$"
"world"
"hello-world"
"$$substring(5,-5):$"
"-"
"hello-world"
"$$substring(-5,-1):$"
"worl"
12345678
"$$substring(-5,-1):$"
"4567"