ios 替换字符串中的部分字符串

1、使用NSString中的stringByTrimmingCharactersInset:[NSCharacterSet whitespaceCharacterSet]方法去掉左右两边的空格;

2、使用NSString中的stringByReplacingOccurrencesOfString:@"我" withString @"你"],用来把字符串中的所有我替换成你。

posted @ 2017-01-17 20:15  皆木  阅读(7768)  评论(0编辑  收藏  举报