Here you can find the source of regionMatchesIgnoreCase(char[] string, int toffset, String other, int ooffset, int len)
private static boolean regionMatchesIgnoreCase(char[] string, int toffset, String other, int ooffset, int len)
//package com.java2s; /*//from w w w . j ava2s .c o m * This file is part of the Jose Project * see http://jose-chess.sourceforge.net/ * (c) 2002-2006 Peter Sch?fer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * */ public class Main { private static boolean regionMatchesIgnoreCase(char[] string, int toffset, String other, int ooffset, int len) { if (toffset < 0 || (toffset + len) > string.length) return false; if (ooffset < 0 || (ooffset + len) > other.length()) return false; while (len-- > 0) { if (Character.toUpperCase(string[toffset++]) != Character.toUpperCase(other.charAt(ooffset++))) return false; } return true; } public static final boolean regionMatchesIgnoreCase(String string, int toffset, StringBuffer other, int ooffset, int len) { if (toffset < 0 || (toffset + len) > string.length()) return false; if (ooffset < 0 || (ooffset + len) > other.length()) return false; while (len-- > 0) { if (Character.toUpperCase(string.charAt(toffset++)) != Character.toUpperCase(other.charAt(ooffset++))) return false; } return true; } public static final boolean regionMatchesIgnoreCase(StringBuffer string, int toffset, String other, int ooffset, int len) { if (toffset < 0 || (toffset + len) > string.length()) return false; if (ooffset < 0 || (ooffset + len) > other.length()) return false; while (len-- > 0) { if (Character.toUpperCase(string.charAt(toffset++)) != Character.toUpperCase(other.charAt(ooffset++))) return false; } return true; } public static final boolean regionMatchesIgnoreCase(StringBuffer string, int toffset, StringBuffer other, int ooffset, int len) { if (toffset < 0 || (toffset + len) > string.length()) return false; if (ooffset < 0 || (ooffset + len) > other.length()) return false; while (len-- > 0) { if (Character.toUpperCase(string.charAt(toffset++)) != Character.toUpperCase(other.charAt(ooffset++))) return false; } return true; } public static final boolean regionMatchesIgnoreCase(String string, int toffset, char[] other, int ooffset, int len) { if (toffset < 0 || (toffset + len) > string.length()) return false; if (ooffset < 0 || (ooffset + len) > other.length) return false; while (len-- > 0) { if (Character.toUpperCase(string.charAt(toffset++)) != Character.toUpperCase(other[ooffset++])) return false; } return true; } public static final int length(Object string) { if (string instanceof String) return ((String) string).length(); if (string instanceof StringBuffer) return ((StringBuffer) string).length(); throw new IllegalArgumentException("expecting String or StringBuffer"); } }