Try using something like
String u = "www.facebook.com/lol";
URL url = new URL(u);
String host = url.getHost(); // should be www.facebook.com
If you need different parts of the Url look at the documentation and the other getters here: http://developer.android.com/reference/java/net/URL.html