Android String to URL Convert preUrl(String url)

Here you can find the source of preUrl(String url)

Description

pre Url

License

Apache License

Declaration

public static String preUrl(String url) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static String preUrl(String url) {
        if (url == null) {
            return null;
        }/* w  w  w. j  av  a  2  s . co m*/
        if (url.startsWith("http://") || url.startsWith("https://")) {
            return url;
        } else {
            return "http://" + url;
        }
    }
}

Related

  1. getDomain(String url)
  2. findUrl(StringBuilder sb)
  3. isImageUrl(String imgUrl)
  4. getBaseUrl(String pageUrl)
  5. getYoutubeId(String url)
  6. TruncateUrlPage(String strURL)
  7. isValidUrl(String url)
  8. imageUrl_2_ImageName(String imageUrl)
  9. extractUrls(String text)