substr has 1 variant:
substr
substr functions allows you to extract a substring from a string.
If start_position is 0, then the SUBSTR function treats start_position as 1 (ie: the first position in the string).
If start_position is a positive number, then the SUBSTR function starts from the beginning of the string.
If start_position is a negative number, then the SUBSTR function starts from the end of the string and counts backwards.
If length is a negative number, then the SUBSTR function will return a NULL value.
char substr(char string, int startPosition, int length);
char str; str = substr("This is a test", 6, 2);
Result: "is"
Last updated 5 years ago