Java tutorial
//package com.java2s; public class Main { public static boolean isStringValidURL(String str) { return isValidString(str) && (str.toLowerCase().startsWith("http://") || str.toLowerCase().startsWith("https://")); } public static boolean isValidString(String str) { return str != null && str.length() != 0; } }