如何以编程方式转换:
@"This is any NSString with some blanks"
到此?
@"This+is+any+NSString+with+some+blanks"`
答案 0 :(得分:8)
NSString *firstString = @"This is any NSString with some blanks";
NSString *secondString = [firstString stringByReplacingOccurrencesOfString:@" " withString:@"+"];