nscharacterset

Strip Non-Alphanumeric Characters from an NSString

I'm looking for a quick and easy way to strip non-alphanumeric characters from an NSString. Probably something using an NSCharacterSet, but I'm tired and nothing seems to return a string containing only the alphanumeric characters in a string. ...

NSCharacterSet: How do I add "_" to alphanumericCharacterSet text restriction?

Building an NSCharacter set to restrict a UITextField for entering user names. I want the user to be able to also enter an underscore (so [A-Za-z0-9_]) but alphanumericCharacterSet does not include it. Is there a way to specify a range like that in short form? I see + (id)characterSetWithRange:(NSRange)aRange, but I'm not really understa...

NSString - replacing characters from NSCharacterSet

Hi Everyone, I gotta little question about string Programming: I have an NSCharacterSet which contains all the characters I want to remove from my NSString. How can I do that? Thank you, Christian ...

how to print characterSet in objective c?

i'm using GNUstep shell for programming objective-c. I'm able to convert string to a character set. But unable to print the converted character set in the console. Please tell me a way to print it. Thanks in advance. ...

How to use NSLineSeparatorCharacter and NSParagraphSeparatorCharacter?

I wonder how I can use the constants NSLineSeparatorCharacter and NSParagraphSeparatorCharacter as a parameter to a function instead of hard coding \n. - (id)initWithSeparator:(id)separator { m_separator = separator; } What would be the correct parameter type and what conversion needs to be done? Depending on the file contents I wish...

'NSCharacterSet' may not respond to '-count'

I got a warning message in NSCharacterSet *myCharSet3 = [NSCharacterSet characterSetWithCharactersInString:query3]; int chr_count3; chr_count3=[myCharSet3 count]; How to fix that warning ? ...