objective c - How to detect space, and special characters like :, ?,`,~, etc in text of a textfield in iPhone SDK? -


how detect space, , special characters :, ?,`,~, etc in text of textfield in iphone sdk?

try this..

nscharacterset* symbols = [nscharacterset symbolcharacterset];    if([symbols characterismember: yourcharacter]) {         //check condition here     } 

if want include many characters use combined nscharacterset nsmutablecharacterset..

    nsmutablecharacterset *space = [nsmutablecharacterset charactersetwithcharactersinstring:@" "];     [space formunionwithcharacterset:[nscharacterset symbolcharacterset]]; 

use space characterset check character


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -