Questions tagged [nscharacterset]

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.

103 questions
0
votes
1 answer

unicode general category z* in whitespaceAndNewlineCharacterSet

in nscharacterset class there is whitespaceAndNewlineCharacterSet method which returns few unicodes, i was wondering what is z*,i searched online but couldn't find any explanations. can anyone tell what does unicode category z* mean exactly??? …
n devaraj
  • 114
  • 9
0
votes
1 answer

How to solve Chinese character display in MySQL?

after Mysql installation , I create a table and add some records like this create table score ( student_id int, subject varchar(10), subject_score int ); insert into score values (001,'数学',50),(002,'数学',60),(003,'数学',70); and the…
LawrenceLi
  • 339
  • 3
  • 8
0
votes
2 answers

Remove unallowed characters from NSString

I want to allow only specific characters for a string. Here's what I've tried. NSString *mdn = @"010-222-1111"; NSCharacterSet *allowedCharacterSet = [NSCharacterSet characterSetWithCharactersInString:@"+0123456789"]; NSString *trimmed = [mdn…
Ryan
  • 4,467
  • 1
  • 27
  • 46
0
votes
1 answer

How to check a string using AND or OR logic with NSCharacterSet

I am using Zxing library to scan the Barcodes. The result is stored in an NSString. Here I am looking into two cases: Case:'semicolon' : If the result string contains semicolon character....then store it in Semicolon Array myWords_semicolon…
Teja Nandamuri
  • 10,632
  • 6
  • 54
  • 95
0
votes
1 answer

trim white space and x number of characters at the end of the string

let us consider this as a string--'Wi-Fi 1234ff' i would like to trim this as -'wifi' removing last 6 characters, special characters and space. what i tried is to remove space- NSString *trimmedString = [myString…
Avis
  • 495
  • 4
  • 13
0
votes
0 answers

Objective C - NSString accept all alphanumeric characters from all languages

I want to allow users to create username in all languages [English, French, German, Thai, Arabic, etc], but disallow non-numeric characters such as ,./#|{ etc in NSString. How do I do this in objective-c? Solution based on alphanumericCharacterSet…
kevin
  • 3,707
  • 10
  • 29
  • 33
0
votes
2 answers

NSString manipulation. Remove only date

If I have a NSString at looks like: 2-13-2014 Norway vs Canada Per 1 20-00 2 Its being parsed and the dates will change How do I make it turn into Norway vs Canada Per 1 In other words, drop the date and extra characters at the end. Iv'e…
0
votes
1 answer

Exclude "@" sign from punctuationCharacterSet

I am trying to filter my attributedString this way, using this code. However, I want the rangeOfCharacterFromSet: to include all of its original values EXCEPT for the "@" sign. How would I do this? NSRange rangeSpace = [filteredText…
user2284295
0
votes
1 answer

how to check if an alphanumeric character is entered in text filed in iOS

I am having a condition in which i want to check if there are any special characters entered in textfield. If there are no special characters entered it should return YES. If a special character is entered in textfield a check is made to check if…
Rani
  • 2,907
  • 11
  • 46
  • 87
0
votes
1 answer

Having trouble with BOOL method

I am trying to restrict a UITextField's input to only alphanumeric characters ie. letters and numbers. I found a BOOL method implementation here on stack overflow: https://stackoverflow.com/a/16147160/3344977 So here is what I did with my code after…
user3344977
  • 3,454
  • 4
  • 29
  • 82
0
votes
1 answer

Is it possible to call "location" on rangerOfCharacterFromSet without dot notation in objective-c?

I am trying to write this without dot notation but can't figure it out: [[textField text] rangeOfCharacterFromSet:someInstanceVar].location I keep getting bad receiver type NSRange (aka '_struct NSRange') Is this not possible? Kind regards
LondonGuy
  • 9,643
  • 9
  • 68
  • 143
0
votes
1 answer

How to change CharacterSet in HDFS

I have a small Hadoop cluster version 1.1.2, while running some basic word counts on text files written in German I noticed that HDFS is not handling well special characters like ü,ö,ä etc. Is there a way to change the CharacterSet used in HDFS…
eruh
  • 11
  • 2
0
votes
2 answers

How to trim a string which is having substring in "( )"?

I've a string in India(IND), now i want to trim the characters which are included in parentheses(IND). I just want "India" I'm trying to use - (NSString *)stringByTrimmingCharactersInSet:(NSCharacterSet *)set; i don't know how to provide…
Akshay
  • 227
  • 2
  • 13
0
votes
2 answers

CharacterInString not producing expected result

I have this code: NSCharacterSet *characterSet = [NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyz1234567890"]; NSLog(@"character set: %i", [characterSet characterIsMember:(unichar)"a"]); The NSLog returns 0, when I…
Andrew
  • 15,489
  • 25
  • 116
  • 200
0
votes
0 answers

Is there a way to remove the newline created between an NSMutableDictionary key/object pair when writing to a file?

I'm trying to make the entries in my NSMutableDictionary look like this when written to a file: Track ID686 NamePoetic Justice (Feat. Drake)