Here you can find the source of startsWithIgnoreCase(String s, int offset, int end, String lowerCase)
static boolean startsWithIgnoreCase(String s, int offset, int end, String lowerCase)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); public class Main { /**//from w ww. j a v a2 s . com * True if the lower-case version of s[off:end] starts with the given * lower-case string. */ static boolean startsWithIgnoreCase(String s, int offset, int end, String lowerCase) { int n = lowerCase.length(); if (end - offset < n) { return false; } int off = offset; for (int i = 0; i < n; ++off, ++i) { if (lcase(s.charAt(off)) != lowerCase.charAt(i)) { return false; } } return true; } /** * True if the lower-case version of s[off:end] starts with the given * lower-case string. */ static boolean startsWithIgnoreCase(char[] s, int offset, int end, String lowerCase) { int n = lowerCase.length(); if (end - offset < n) { return false; } int off = offset; for (int i = 0; i < n; ++off, ++i) { if (lcase(s[off]) != lowerCase.charAt(i)) { return false; } } return true; } /** Returns ch or the lower-case equivalent if ch is in ['A'..'Z']. */ static char lcase(char ch) { return 'A' <= ch && ch <= 'Z' ? (char) (ch | 32) : ch; } static char charAt(char[] s, int i) { return s[i]; } }