我需要从我的字符串中删除各种“网络起点”
我的 TextView 必须没有 "http://"、 "http://www.",“万维网”和其他 URL 前缀。
请你帮我解决这个问题?
最佳答案
使用 URI
的实例并使用它来拆分你想要的:
URI uri = new URI(whateverYourAddressStringIs);
String path = uri.getPath(); // split whatever you need
关于java - 从字符串中删除 URL 前缀(http :/, www 等),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16673628/