I have a bunch of strings I need to extract numbers from. They're in the format:
XXXX001
XXXXXXX004
XX0234X
There's a lot of these, and i need to loop over them all and extract all the numbers.
So what's the quickest/most efficient way, using ASP.NET 3.5, to find the first instance of a number within a string?
Update I should've included more info - getting answers providing me with ideas on how to extract all the numbers, rather than find the first index. Not a problem - I'm sure others will find them useful.
In my case I actually need the index, because I'm doing some more analysis of the strings (ie. there may be a range XXXX0234-0237XX or a pair XXXXX0234&0238XX.
Finding the index of the first number helps me target the interesting part of the string for inspection.