Chopping off the end of a string with - (void)deleteCharactersInRange:(NSRange)aRange
Chopping off the end of a string with - (void)deleteCharactersInRange:(NSRange)aRange
- Subject: Chopping off the end of a string with - (void)deleteCharactersInRange:(NSRange)aRange
- From: Mark Ogilvie <email@hidden>
- Date: Mon, 3 Mar 2003 17:03:59 -0500
I've been working my way through some NSString programs to get the hang
of them and I wanted to remove a set number of letters (doesn't matter
what the letters are) from the end of a string. I spotted the
deleteCharactersInRange method and thought to just use a for-loop to go
back from the end of the string, but it calls for an NSRange object and
there is no NSRange listed in help. The only thing listed is
NSRangeSpecifier. Nor did I find much on an archive search. I know
that a NSRange object is a struct with two integers, start and length,
but I can't find anything on how you can create one from a string. Or
is there a more obvious way of shrinking a string?
Thanks
Mark
http://members.ttlc.net/~mso/WebPage1.html
_______________________________________________
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.