I have an NSMutableArray with some NSString items . The problem is that , the string items contains some white spaces in the path name . how to remove the extra space in these strings . I manually replaced the white space with the '%20' like this
http://mysites/livingrom/quaba%20mcose%2001_12.jpg
But how to replace all the white spaces from the items in my array .
NSString *pic1 = http://mysites/livingrom/quaba mcose 01_12.jpg
NSString *pic2 = http://mysites/livingrom/quaba mcose 01_13.jpg
NSString *pic3 = http://my开发者_如何学编程sites/livingrom/quaba mcose 01_14.jpg
NSString *pic4 = http://mysites/livingrom/quaba mcose 01_15.jpg
Try this with all the NSStrings:
[pic1 replaceOccurrencesOfString:@" " withString:@""];
I'm not sure if this will work, I've only used it to replace strings when reading from files. It's worth a try though.
精彩评论