Finding
the Position of the First Digit
It is sometimes required to find the
position of the first digit or a character in a string or contents
of a field. This can be elegantly obtained:
scan field1, # ; $result will
have the position of the first digit
E.g. if field1 contains London EC1
2SZ
scan field1, # ; $result = 10
Similarly,
scan field2, & ; $result
will have the position of the first character
E.g. if field2 contains 10th
anniversary
scan field2, & ; $result =3
|