• 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: String subtraction
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: String subtraction


  • Subject: Re: String subtraction
  • From: Marcel Weiher <email@hidden>
  • Date: Tue, 25 Mar 2003 09:37:38 +0100

NSString *c1 = [s1 substringWithRange:NSMakeRange(i-1,i)];


(where s1 is the original string, and s2 contains the characters to remove)--but am receiving range errors, for some reason (I'm probably missing something obvious--if anyone can point out the problem I'd be much obliged).

Yes. NSRange is (location, length), not ( location1, location2 ). So you need NSMakeRange( i-1, 1 )

Marcel

--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
_______________________________________________
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.

References: 
 >String subtraction (From: Andrew Merenbach <email@hidden>)

  • Prev by Date: Re: AppleSkript & cocoa App
  • Next by Date: Programmatically scrolling
  • Previous by thread: RE: String subtraction
  • Next by thread: Re: String subtraction
  • Index(es):
    • Date
    • Thread