UITextField : Remove the white space (Escape Sequences) in TextField

Look the code:
/*********************************Categories*************************************/
@interface UITextField(removeWhiteSpace)
– (NSString *)removeWhiteSpaces;
@end

/*********************************Implemented***********************************/
@implementation UITextField(removeWhiteSpace)
– (NSString *)removeWhiteSpaces
{
self.text=[self.text stringByTrimmingCharactersInSet:
[NSCharacterSet whitespaceCharacterSet]];
return self.text;
}
@end

Advertisements