Name
substring — Returns part of a string
Synopsis
string
substring
( |
string
| STRING
, |
|
integer
| OFFSET
, |
|
integer
| LENGTH
) ; |
Parameters
-
string
STRING
Original String
-
integer
OFFSET
Start position
Optional Arguments
-
integer
LENGTH
Length of new string
Description
Returns the portion of STRING
specified by the OFFSET
and LENGHT
parameters. OFFSET
starts with 0.
Usage
substring ("some text", 5) -> "text"
substring ("some text", 42) -> ""
substring ("some text", 5, 2) -> "te"
substring ("some text", 42, 2) -> ""
substring("123456789", 2, 3) -> "345"