• 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: HELP!! [self needsHelpWith:strings];
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HELP!! [self needsHelpWith:strings];


  • Subject: Re: HELP!! [self needsHelpWith:strings];
  • From: email@hidden
  • Date: Tue, 21 May 2002 09:08:44 -0700

Christopher OBrien wrote:
|I am working on a major major project and I need to remove certain
|characters from an NSString. Is it also possible to remove white space
|from an NSString?

Have you read the NSString and NSMutableString documentation? The problem amounts to

for each character in string
if the character is one of the "certain characters",
delete it

The basic methods would be characterAtIndex: and deleteCharactersInRange:. You could get fancier with rangeOfCharactersFromSet:.

As to white space, there's nothing special about it; white space is just "certain characters", too. The question is simply what characters you want to consider "white space". Once you've decided that, you delete them like any other set of characters.

Glen Fisher
_______________________________________________
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: 
 >HELP!! [self needsHelpWith:strings]; (From: Christopher OBrien <email@hidden>)

  • Prev by Date: Re: HELP!! [self needsHelpWith:strings];
  • Next by Date: Re: AwakeFromNib
  • Previous by thread: Re: HELP!! [self needsHelpWith:strings];
  • Next by thread: Re: HELP!! [self needsHelpWith:strings];
  • Index(es):
    • Date
    • Thread