public static boolean osSensitiveEndsWith ( String str , String suffix ) { if ( OS_CASE_SENSITIVE ) { return str . endsWith ( suffix ) ; } else { int strLen = str . length ( ) ; int suffixLen = suffix . length ( ) ; if ( strLen < suffixLen ) { return false ; } return ( str . substring ( strLen - suffixLen ) . equalsIgnoreCase ( suffix ) ) ; } }
Tell whether a string ends with a particular suffix with case sensitivity determined by the operating system .