This simple validation method for NSString
makes trouble.
I have an NSString
value and I want to validate the string, i.e, if the string contains only 'a to z' (or) 'A to Z' (or) '1 to 9' (or) '@,!,&' then the string is valid. If the string contains any other values then this the NSString
is invalid, how can i validate this..?
As example:
Valid:
NSString *str="aHrt@2"; // something like this
Invalid:
NSString *str="..gS$"; // Like this