Re: String subtraction
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.