What's the best way to remove the extension of an url in iPhone?
I was using [urlString stringByDeletingPathExtension]
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].
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With