Link to home
Start Free TrialLog in
Avatar of chuang4630
chuang4630

asked on

What is the most efficient way of extract the leading numbers from a string?

What is the most efficient way of extract the leading numbers from a string?

Example: 1020D Main Street.
Intended result: 1020
ASKER CERTIFIED SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Actually just thought of a slighter faster way:

Loop from the BACK of the array to the front while isdigit = false

the rest from 0 to element is your address