开发者

Remove extension of url in iPhone

开发者 https://www.devze.com 2023-01-26 12:53 出处:网络
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 som

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].

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号