开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜