stringByAppendingString和stringBy
2018-09-14 本文已影响0人
清风_____
stringByAppendingPathComponent 是路径拼接会多出“/”
stringByAppendingString 是字符串拼接无“/”
NSString *imagePath1 = [@"str1" stringByAppendingString:@"str2"];
NSString *imagePath2 = [@"str1" stringByAppendingPathComponent:@"str2"];
NSLog(@"imagePath1:%@ imagePath2:%@",imagePath1,imagePath2);
输出结果:imagePath1:str1str2 imagePath2:str1/str2