去除NSString里面的空格 NSString *password = @"12 34"; [password stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];