• 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: representing TABs in NSString.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: representing TABs in NSString.


  • Subject: Re: representing TABs in NSString.
  • From: Jake <email@hidden>
  • Date: Sun, 2 Dec 2001 16:38:27 -0500 (EST)

Thanks for the suggestions. Okay, what happend to me was that when I later
casted that NSCharacterSet to NSScanner's skipSet, it was skipping tabs
when I used scanUpToString:inToString. I will try both of those now.

Thanks again.

> > [wanttab removeCharactersInRange:NSMakeRange('\t',1)];
>
> You really shouldn't have to do that, though. There is nothing special
> about the tab character; something else is wrong in your code. Here's
> my test:
>
> {
> NSString *tabString = @"\t";
> NSMutableCharacterSet *charSet;
>
> NSLog(@"string length (should be 1): %u", [tabString length]);
>
> charSet = [[NSCharacterSet controlCharacterSet] mutableCopy];
> NSLog(@"is tab in controlCharacterSet? (should be 1): %d",
> [charSet characterIsMember:'\t']);
>
> [charSet removeCharactersInString:tabString];
> NSLog(@"is tab in charSet? (should be 0): %d", [charSet
> characterIsMember:'\t']);
> }
>
> The results are
>
> string length (should be 1): 1
> is tab in controlCharacterSet? (should be 1): 1
> is tab in charSet? (should be 0): 0
>
> so it appears to work just fine.
>
> --
> Kurt Revis
> email@hidden


References: 
 >Re: representing TABs in NSString. (From: Kurt Revis <email@hidden>)

  • Prev by Date: NSConnection and Spinning Cursor Of The Death ...
  • Next by Date: Re: Newbie
  • Previous by thread: Re: representing TABs in NSString.
  • Next by thread: awakeFromNib called twice !
  • Index(es):
    • Date
    • Thread