substr — extract a portion of a string
string substr( |
str, | |
start, | ||
end) ; |
string | str; |
int | start; |
int | end ; |
Returns a specified sub section of the string str. The section returned is the section starting at character index start up to but not including character index end. If the optional parameter end is omitted then the entire string, starting at start, is returned. Note that character indices are zero based, so that substr(str, 0) == str.
The following conditions lead to undefined results, most likely runtime errors: