Re: reverse scanner
Re: reverse scanner
- Subject: Re: reverse scanner
- From: Sandor Szatmari <email@hidden>
- Date: Sat, 10 Aug 2013 15:27:14 -0400
If one number has a leading leading zero will the other number have one, if applicable? For instance, is 60 followed by 7 distinguishable from 6 followed by 07?
Sandor Szatmari
On Aug 10, 2013, at 13:07, Boyd Collier <email@hidden> wrote:
> I'm dealing with a situation in which I have to scan strings that are separated by tabs, and for each string, I have to extract two numerical values, with these values being separated by a non-numerical character or not being separated by any character at all. I know the maximum number of characters used to represent each number, but unfortunately, the first character in the group of characters used to represent the first number can, quite arbitrarily, be either a 0 or missing. For example, with the number of characters used to represent each number known to be 2, the strings 607, 0607, 06;07 (note the semicolon between 06 and 07) should all result in 6 and 7 being extracted as the two numerical values. Of course, I'd like to do something simple, and were it not for the arbitrary inclusion of a leading 0, it would be quite simple to use an instance of NSScanner. Or, if there were such a beast as NSReverseScanner, it would also be relatively straight forward, but so far as I'm aware, no such beast exists. I can think of a couple of ways do accomplish this task, but if someone has already come up with a clean way of scanning in reverse, I'd appreciate hearing from them.
>
> Boyd
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden