Here you can find the source of startsWithIgnoreCase(String originalString, String checkPhrase)
Parameter | Description |
---|---|
originalString | a string |
checkPhrase | a phrase to compare with |
public static boolean startsWithIgnoreCase(String originalString, String checkPhrase)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w. j a v a2 s . c om * Check if a string starts with another phrase, case-ignored * @param originalString a string * @param checkPhrase a phrase to compare with * @return true / false */ public static boolean startsWithIgnoreCase(String originalString, String checkPhrase) { if (originalString == null || checkPhrase == null) { return false; } return originalString.toLowerCase().startsWith(checkPhrase.toLowerCase()); } }