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 <bcolli...@cox.net> 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 (Cocoa-dev@lists.apple.com) > > 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: > https://lists.apple.com/mailman/options/cocoa-dev/admin.szatmari.net%40gmail.com > > This email sent to admin.szatmari....@gmail.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com