Remove extension of url in iPhone
What's the best way to remove the extension of an url in iPhone?
I was using [urlString strin开发者_高级运维gByDeletingPathExtension]
but I just realized that it replaces http://
with http:/
for some unknown reason. Most likely this method is for file paths, not urls.
If the string operation reduces // to / (as a double slash does not make sense in a path), just use the URL counterpart, URLByDeletingPathExtension: on a NSURL object, which you create with [NSURL URLWithString:urlString].
精彩评论