//定义一个字符串 NSString *str =@" HGGHSDgAs das djahkadafqskj lxacna ma zb c A sGHFGHGH ";
NSString *str1=[str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
运行结果:2015-10-01 16:30:59.977 16-测试[1072:34512] str=HGGHSDgAs das djahkadafqskj lxacna ma zb c A sGHFGHGH Program ended with exit code: 0
|