Resolved SubString with a twist?

thek

Member
Joined
May 31, 2009
Messages
22
Programming Experience
Beginner
Hi guys

First time poster - be gentle ;-)

I have a string : 35johnsmith90210 (It should be spilt like this 35 JohnSmith 90210 (Age Name Zipcode)

My problem is at SubString will do the job for me, but next string could look like this: 101OldGranny91222
So I can't determind the number - for the split - of char in the string, because it changes depending on there name etc.

Any tips on doing this? I'm not sure if IndexOf will do the trick?

Thanks
 
Last edited:
Mangled data like that is something you typically get from document text of a WebBrowser displaying table data. If this is the case you're better off reading the table cells from the browser.
 
Hi JohnH

Thanks for your reply.

No, I get the information in a file looking like this:


15SarahSmith90210
100OldTimer35500
30JohnHomles00830

And so on.

The only way I see it, is to read the string and determind the first "letter char", and then grab all to the left of that char (and store it).
Then carry on until I reach a INT char, and grab all to the left of that INT char , etc.

But is it possible? If yes how?
 
Of course it is possible. You can loop the string as an array of Char and use the Char methods to analyze, or you can use Regex to capture string patterns.
 
Back
Top