Sim*_*mon 56
使用它的实例URI并使用它来分割你想要的:
URI uri = new URI(whateverYourAddressStringIs);
String path = uri.getPath(); // split whatever you need
Run Code Online (Sandbox Code Playgroud)
http://developer.android.com/reference/android/net/Uri.html
kin*_*ori 28
您可以使用正则表达式来完成此操作
"www.aaa".replaceFirst("^(http[s]?://www\\.|http[s]?://|www\\.)","")
Run Code Online (Sandbox Code Playgroud)
你可以使用String替换.
String myString = "http://www.abc.com";
myString.replace("http://","").replace("http:// www.","").replace("www.","");
Run Code Online (Sandbox Code Playgroud)