An NSCharacterSet object represents a set of Unicode-compliant characters. NSString and NSScanner objects use NSCharacterSet objects to group characters together for searching operations, so that they can find any of a particular set of characters during a search. The cluster’s two public classes, NSCharacterSet and NSMutableCharacterSet, declare the programmatic interface for static and dynamic character sets, respectively.
Questions tagged [nscharacterset]
102 questions
0
votes
3 answers
Comparing each character in an NSString against a collection of characters
My intent is to analyze the user's input from a text field and check if he used any symbols.
For example, user's input is "/ardv/*k" and I need a variable that says the user typed 3 symbols.
I do not understand how to use NSRange to search against a…

silverSuns
- 218
- 2
- 16
0
votes
2 answers
compare characters from nsstring to different charactersets
I want to compare each character in an nsstring one by one to different nscharactersets and perform different operations according to the characterset it matches.
I'm able to assign each character to a substring for comparison using a for loop.
-…

Ramin Afshar
- 989
- 2
- 18
- 34
0
votes
5 answers
Removing Character issue from NSString in iPhone
I have a string with value "€100,000,000". I want to remove the '€' and ',' at the same time. I am try to use [NSCharacterSet symbolSet] but this method only removes the '€' without removing the ','.

Yuvaraj M
- 340
- 2
- 13
0
votes
2 answers
NSCharacterSet cuts the string
I am getting lastest tweet and show it in my app. I put it in a NSMutableString and initialize that string like below in my xmlparser.m file:
- (void) parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
{
currentNodeContent =…

user1244069
- 95
- 2
- 12
-1
votes
4 answers
Textfield Validation using CharacterSet
I have written below code to validate text input in textfield.
else if (textField == txtField_Password)
{
let charSet = CharacterSet(charactersIn: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@$&*!")
let…

Yash Jadhav
- 95
- 1
- 14
-1
votes
3 answers
Remove Special Character From String
I have a String W
NSString * stringTitle = link.title;
where i am getting link.title as @"I_AM_GOOD";
I need to remove the special characters "_" and make is as "I am Good".How to do that?

Wodjefer
- 345
- 2
- 6
- 19
-1
votes
1 answer
How to Validate Symbol Characterset in Objective c?
Why is it taking range.length nil. I entered text Demo@123. In this special character is their but length will taking nil.
NSRange rang = [textField.text rangeOfCharacterFromSet:[NSCharacterSet symbolCharacterSet]];
if ( !rang.length ) {
return…

RameshIos
- 301
- 1
- 4
- 13
-1
votes
1 answer
Replace array of characters in NSString
I am trying to replace an array of characters from within an NSString.
For example if we have this string:
NSString *s = @"number one and two and three";
NSArray *A1 = [NSArray arrayWithObjects:@"one",@"two",@"three", nil];
NSArray *A2 =…

Fawaz
- 584
- 1
- 11
- 24
-1
votes
2 answers
How to Compare Two Different Strings (string1 contains string2)
I am having Two Strings:string1 and string2.
String1 contains only "ball", string2 contains "ball,fruit,doll".
Now i need to compare the string1 and string2, ball is in both the strings or not?
and i need to remove the ball after comparing the…

Krishna1251
- 177
- 1
- 10
-1
votes
1 answer
uitextview shouldChangeTextInRange work in all method
I've input all the 3 methods in - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)string
However, three of the following method can only work 1 of them, I wonder how should the code be written…

zeropt7
- 73
- 1
- 9
-2
votes
2 answers
Prevent user from entering text
I'm following the book
IOS Programming : The Big Nerd Ranch Guide
And I'm in the part where you create a simple app that converts Fahrenheit to Celsius and the final Challenge is to prevent users from typing alphabetical characters, here is my…

OmarAguinaga
- 707
- 1
- 8
- 17
-2
votes
3 answers
How to remove blank spaces from a string in iOS
Possible Duplicate:
Replacing one character in a string in Objective-C
Remove all whitespace from NSString
@"this string contains blank spaces".
How can we convert this string into @"thisstringcontainsblankspaces".
I mean how can we trim all…

A for Alpha
- 2,904
- 8
- 42
- 76