Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
NSString *myString = @" New Profile "
我想删除我的字符串中空白的前面和结尾。
试试这个它也会删除空白的新行:
NSString *temp = @" untrimmed string "; NSString *newString = [temp stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];