Here you can find the source of startsWithIgnoreCase(String s, String start)
Parameter | Description |
---|---|
s | the string to check (must be longer than start) |
start | the prefix of s |
public static boolean startsWithIgnoreCase(String s, String start)
//package com.java2s; //License from project: Open Source License public class Main { /**//from ww w. j a v a 2 s.co m * Check is a string starts with another string, ignoring the case. * * @param s the string to check (must be longer than start) * @param start the prefix of s * @return true if start is a prefix of s */ public static boolean startsWithIgnoreCase(String s, String start) { if (s.length() < start.length()) { return false; } return s.substring(0, start.length()).equalsIgnoreCase(start); } }