android 路径网址Uri、UrL 字符串解析

不分解字符串,path、url 解析,关键代码块:


Uri uri = Uri.parse(url);
Set<String> names = uri.getQueryParameterNames();
for (String name : names) {
    System.out.println("name:" + name);
    String parameter = uri.getQueryParameter(name);
    System.out.println("parameter:" + parameter);
}

System.out.println("========");

List<String> list = uri.getPathSegments();
for (String pathSegment : list) {
    System.out.println(pathSegment);
}


aikongmeng CSDN认证博客专家 RxJava 性能优化 Android Jetpack
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( T | o ) ( Y | o | u | t | h | , | T | o ) ( S | i | m | p | l | e | ! )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
©️2020 CSDN 皮肤主题: 猿与汪的秘密 设计师:上身试试 返回首页