Android Utililty Methods URL Parse

List of utility methods to do URL Parse

Description

The list of methods to do URL Parse are organized into topic(s).

Method

StringhostFromUrl(String url)
host From Url
String host = url;
int index = host.indexOf("://");
if (index != -1) {
    host = host.substring(index + 3);
index = host.indexOf("/");
if (index != -1) {
    host = host.substring(0, index);
...
booleanhasParameter(String url, String name)
has Parameter
int index = url.lastIndexOf('/') + 1;
if (index == -1 || index >= url.length()) {
    return false;
index = url.indexOf('?', index);
while (index != -1) {
    int start = index + 1;
    if (start >= url.length()) {
...
booleanvalidateUrl(String url)
validate Url
return Patterns.WEB_URL.matcher(url).matches();