Universeorange.com/Docs/

R3m/framework Function reference string.substring

{string.substring(String $string, Int $offset=0, Int $length=null)}

Returns the portion of string specified by the offset and length parameters.

string
    The input string.
offset
    If offset is non-negative, the returned string will start at the offset'th position in string, counting from zero. 
    For instance, in the string 'abcdef', the character at position 0 is 'a', the character at position 2 is 'c', and so forth.
    If offset is negative, the returned string will start at the offset'th character from the end of string.
    If string is less than offset characters long, false will be returned. 
length 
    If length is given and is positive, the string returned will contain at most length characters beginning from offset (depending on the length of string).
    If length is given and is negative, then that many characters will be omitted from the end of string (after the start position has been calculated when an offset is negative). 
    If offset denotes the position of this truncation or beyond, false will be returned.
    If length is given and is 0, false or null, an empty string will be returned.
    If length is omitted, the substring starting from offset until the end of the string will be returned. 

Returns the extracted part of string; or false on failure, or an empty string.

More information:

https://www.php.net/manual/en/function.substr.php

Last modified: 2021-06-07

© 2021 universeorange.com