string_part [function]
string_part( string str, int from[, int len[, int flags]] )
returns a part of string str
, starting at from
, at most len
characters
- if
len
is not specified, len
is assumed to be the number of characters between from
and the end of string str
- if
from
is negative, it points to characters before the end of string (-1 being the last one)
- if
len
is negative, the maximum length of returned string is the sum of len
and string str
length
- available values for
flags
:
STRING_NO_REV_INDEX
- emit warnings on negative indices, instead of handling them
STRING_STRICT_RANGES
- emit warnings on out of bounds from
/len
values instead of silently ignoring the outside characters
string_part( "01234567", 3, 3 ); // string [3] "345"