String endpoint = "http://www.google.com.tw"; System.out.println("string index of http:" + endpoint.indexOf("http://")); endpoint = "https://www.google.com.tw"; System.out.println("string index of https:" + endpoint.indexOf("https://")); System.out.println("string re:" + endpoint.matches("^https://.*")); System.out.println("string contain:" + endpoint.contains("http"));
沒有留言:
張貼留言
留個話吧:)