//如果对象是可变的(NSMutableString), 调用方法之后, 可变字符串对象本身可能变,也可能不变
NSMutableString *mStr1 = [NSMutableString stringWithString:@"文艺青年"];//可变字符串
NSString *mStrResult = [mStr1 stringByReplacingOccurrencesOfString:@"文艺" withString:@"213"];//做替换操作
NSLog(@"mStrResult:%@", mStrResult);//返回结果
NSLog(@"mStr1:%@", mStr1);//对象本身没有改变
//解释: 该方法有返回值, 替换之后的结果通过返回值返回, 对象本身不改变
[mStr1 replaceCharactersInRange:NSMakeRange(0, 2) withString:@"213"];//另一种方法做替换操作
NSLog(@"mStr1:%@", mStr1);//对象本身改变.
//解释: 该方法无返回值(返回值类型void), 改变对象本身. 自然, 不可变的(NSString)是没有该方法的
NSString *str1 = [NSString stringWithFormat:@"Hello, world"];
NSString *strResult = [str1 stringByReplacingOccurrencesOfString:@"Hello" withString:@"你好"];
NSLog(@"strResult:%@", strResult);
NSLog(@"str1:%@", str1);