Re: reverse scanner
Re: reverse scanner
- Subject: Re: reverse scanner
- From: "Gary L. Wade" <email@hidden>
- Date: Sat, 10 Aug 2013 10:40:23 -0700
Is there a problem with using a character set of all digits except 0 when recognizing digits?
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/
On Aug 10, 2013, at 10:07 AM, 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