• 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: Jonathan Jackel <email@hidden>
  • Date: Tue, 21 May 2002 11:51:10 -0400

Here's how I do it. You should also check out using NSScanners and
NSCharacterSets, as well as "Strings" in the Cocoa help topics.


- (NSMutableString *)strip:(NSString *)stripChar fromString:(NSString
*)theString
{
NSMutableString *strippedString = [[[NSMutableString alloc] init]
autorelease];
NSRange range;
int x;
int y = [stripChar length];
[strippedString setString:theString];
for (x = 0; x < [strippedString length] - y; x++)
{
range = NSMakeRange(x,y);
if ([[strippedString substringWithRange:range]
isEqualToString:stripChar])
{
[strippedString deleteCharactersInRange:range];
x--;
}
}
return strippedString;
}

Jonathan

on 5/21/02 11:14 AM, Christopher OBrien at email@hidden wrote:

> Hi all. 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? All feedback is welcome and appreciated. Thanks.
> _______________________________________________
> 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.
_______________________________________________
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: Viewing array elements in Project Builder
  • Next by Date: Re: HELP!! [self needsHelpWith:strings];
  • Previous by thread: HELP!! [self needsHelpWith:strings];
  • Next by thread: Re: HELP!! [self needsHelpWith:strings];
  • Index(es):
    • Date
    • Thread