• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSScanner baffling behaviour (scanString:intoString: doesn't work!)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSScanner baffling behaviour (scanString:intoString: doesn't work!)


  • Subject: Re: NSScanner baffling behaviour (scanString:intoString: doesn't work!)
  • From: j o a r <email@hidden>
  • Date: Tue, 8 Apr 2003 16:34:24 +0200

My code snipped was just quickly hacked together in Mail and not tested at all - but I don't think it would fail the scenario that you describe. I don't see why "scanUpToString:" wouldn't work if the search string is at the beginning of the scanned string. Please test it and let me know if you find that I'm wrong.

j o a r

On Tuesday, Apr 8, 2003, at 16:29 Europe/Stockholm, Greg Hurrell wrote:

If the string to be scanned is something like, "<title>Hi there</title>", and the startTag that you are scanning for is "<title>", then will your first [scanner scanUpToString:startTag infoString:nil] not return NO, and hence you'll never pass the "if" statement?

Would this code not be susceptible to that problem?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSScanner baffling behaviour (scanString:intoString: doesn't work!)
      • From: Greg Hurrell <email@hidden>
References: 
 >Re: NSScanner baffling behaviour (scanString:intoString: doesn't work!) (From: Greg Hurrell <email@hidden>)

  • Prev by Date: Re: NSScanner baffling behaviour (scanString:intoString: doesn't work!)
  • Next by Date: Re: NSData to long
  • Previous by thread: Re: NSScanner baffling behaviour (scanString:intoString: doesn't work!)
  • Next by thread: Re: NSScanner baffling behaviour (scanString:intoString: doesn't work!)
  • Index(es):
    • Date
    • Thread