在Objective-C中,我-[NSURL URLByDeletingLastPathComponent]用来获取父URL.在Java中,这相当于什么?
ɲeu*_*urɳ 27
我能想到的最短代码片段是这样的:
URI uri = new URI("http://www.stackoverflow.com/path/to/something");
URI parent = uri.getPath().endsWith("/") ? uri.resolve("..") : uri.resolve(".")
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13472 次 |
| 最近记录: |