0

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 does not solve this problem.

kevin
  • 3,707
  • 10
  • 29
  • 33
  • Try this....NSString *stringWithoutSpaces = [myString stringByReplacingOccurrencesOfString:@"#" withString:@""]; – PSP Sep 20 '14 at 16:43
  • not just #, all non-alphanumeric characters should be disallowed - #,@#$%()etc – kevin Sep 20 '14 at 16:58
  • *Solution based on alphanumericCharacterSet does not solve this problem.* because? – Gerd K Sep 20 '14 at 22:47
  • Gerd, alphanumericCharacterSet includes english albphabets a-Z, doesn't include other language characters. – kevin Sep 20 '14 at 23:47

0 Answers0