美文网首页
stringByAppendingString和stringBy

stringByAppendingString和stringBy

作者: 清风_____ | 来源:发表于2018-09-14 10:39 被阅读0次

stringByAppendingPathComponent 是路径拼接会多出“/”

stringByAppendingString 是字符串拼接无“/”

    NSString *imagePath1 = [@"str1" stringByAppendingString:@"str2"];

    NSString *imagePath2 = [@"str1" stringByAppendingPathComponent:@"str2"];

    NSLog(@"imagePath1:%@    imagePath2:%@",imagePath1,imagePath2);

    输出结果:imagePath1:str1str2         imagePath2:str1/str2

相关文章

网友评论

      本文标题:stringByAppendingString和stringBy

      本文链接:https://www.haomeiwen.com/subject/qfiwgftx.html