NumBreak
Description
This function takes a mixed string "str$", looks the type of the first character, if it is a numeric character, the function will return the index of the first non-numeric character, and vice versa. The optional parameter "offset" specifies the index offset from where the function looks for the "break" position of the first numeric and text character change.
Syntax
int NumBreak(string str$[, int offset])
Parameters
str$
- is a string in which to look for the index of the first numeric and text character change.
offset
- is an index offset starting from which to look for the beak position. Default is 1, which means find from the beginning of the string "str$".
Return
Returns the index at which the first number and non-number change is found in "str$", starting at "offset" (default 1).
If a break, either number or non-number, is not found (i.e. the entire string has no number mixed), it returns 0.
Example
Numbreak("Jan-12")=; //should return 5 Numbreak("Club45North")=; //should returns 5 Numbreak("Club45North", 5)=; //should returns 7 since find starting from "4" Numbreak("Club45North", 3)=; //should returns 5 since find starting from "u" Numbreak("Club45North", 7)=; //should returns 0, starting from "N" and thus no non-digit to digit change found to the end