Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > whitespaceCharacterSet and TAB characters?

whitespaceCharacterSet and TAB characters?
Thread Tools
Brass
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Nov 11, 2003, 08:34 PM
 
Since upgrading to Panther, one of my applications is having a problem trimming strings using code of the form:

Code:
stringB = [stringA stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
Any space characters get trimmed, but tab characters do not get trimmed. The documentation specifically states that this character set includes space and tab characters!

Any one else having problems with this? Any solutions?

My only work around so far is to replace all occurances of "\t" with "" (I guess this will work?).
     
Jan Van Boghout
Registered User
Join Date: Sep 2001
Status: Offline
Reply With Quote
Nov 12, 2003, 07:35 AM
 
You could try [NSCharacterSet characterSetWithCharactersInString:@" \t"] and see if that does the trick if the above fails to work.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 07:11 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,