I am new to Iphone development. I have tried the following code, but it does not work with middle whitespace in UITEXTFIELD
.
NSString *t1 = [txt.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
How ca开发者_开发百科n I avoid middle whitespace?
Use this code may this use full.
NSString *t1=[txt.text stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
NSString *t1= [txt.text stringByReplacingOccurrencesOfString:@" " withString:@""]
精彩评论