@Test public void testAreEqualsLastCharDiff() { assertEquals( -1, Strings.areEquals( AZERTY, 0, "azertY" ) ); }
public static boolean areEquals( String string, int index, String text ) { if ( ( string == null ) || ( text == null ) ) { return false; } int length1 = string.length(); int length2 = text.length(); if ( ( length1 == 0 ) || ( length1 <= index ) || ( index < 0 ) || ( length2 == 0 ) || ( length2 > ( length1 + index ) ) ) { return false; } else { return string.substring( index ).startsWith( text ); } }
Strings { public static boolean areEquals( String string, int index, String text ) { if ( ( string == null ) || ( text == null ) ) { return false; } int length1 = string.length(); int length2 = text.length(); if ( ( length1 == 0 ) || ( length1 <= index ) || ( index < 0 ) || ( length2 == 0 ) || ( length2 > ( length1 + index ) ) ) { return false; } else { return string.substring( index ).startsWith( text ); } } }
Strings { public static boolean areEquals( String string, int index, String text ) { if ( ( string == null ) || ( text == null ) ) { return false; } int length1 = string.length(); int length2 = text.length(); if ( ( length1 == 0 ) || ( length1 <= index ) || ( index < 0 ) || ( length2 == 0 ) || ( length2 > ( length1 + index ) ) ) { return false; } else { return string.substring( index ).startsWith( text ); } } private  Strings(); }
Strings { public static boolean areEquals( String string, int index, String text ) { if ( ( string == null ) || ( text == null ) ) { return false; } int length1 = string.length(); int length2 = text.length(); if ( ( length1 == 0 ) || ( length1 <= index ) || ( index < 0 ) || ( length2 == 0 ) || ( length2 > ( length1 + index ) ) ) { return false; } else { return string.substring( index ).startsWith( text ); } } private  Strings(); static String dumpBytes( byte[] buffer ); static String byteToString( byte b ); static String dumpByte( byte octet ); static char dumpHex( byte hex ); static String dumpHexPairs( byte[] buffer ); static String deepTrim( String str, boolean toLowerCase ); static String deepTrimToLower( String string ); static String deepTrim( String string ); static String trimConsecutiveToOne( String str, char ch ); static String centerTrunc( String str, int head, int tail ); static String toHexString( byte[] res ); static byte[] toByteArray( String hexString ); static String formatHtml( String source, boolean replaceNl, boolean replaceTag,
        boolean replaceQuote ); static boolean areEquals( String string, int index, String text ); static boolean isCharASCII( byte[] byteArray, int index, char car ); static boolean isCharASCII( char[] charArray, int index, char car ); static boolean isCharASCII( String string, int index, char car ); static String utf8ToString( byte[] bytes ); static String utf8ToString( byte[] bytes, int length ); static String utf8ToString( byte[] bytes, int start, int length ); static int areEquals( byte[] bytes, int index, String text ); static int areEquals( char[] chars, int index, String text ); static int areEquals( char[] chars, int index, String text, boolean caseSensitive ); static int areEquals( char[] chars, int index, char[] chars2 ); static int areEquals( char[] chars, int index, char[] chars2, boolean caseSensitive ); static int areEquals( byte[] bytes, int index, byte[] bytes2 ); static boolean isEmpty( String str ); static boolean isEmpty( byte[] bytes ); static String trim( String str ); static byte[] trim( byte[] bytes ); static String trimLeft( String str ); static int trimLeft( char[] chars, int pos ); static void trimLeft( String string, Position pos ); static void trimLeft( byte[] bytes, Position pos ); static int trimLeft( byte[] bytes, int pos ); static String trimRight( String str ); static String trimRight( String str, int escapedSpace ); static int trimRight( char[] chars, int pos ); static String trimRight( String string, Position pos ); static String trimRight( byte[] bytes, Position pos ); static int trimRight( byte[] bytes, int pos ); static char charAt( String string, int index ); static byte byteAt( byte[] bytes, int index ); static char charAt( char[] chars, int index ); static String asciiBytesToString( byte[] bytes ); static byte[] getBytesUtf8( String string ); static byte[] getBytesUtf8Ascii( String string ); static String getDefaultCharsetName(); static boolean equals( String str1, String str2 ); static String listToString( List<?> list ); static String setToString( Set<?> set ); static String listToString( List<?> list, String tabs ); static String mapToString( Map<?, ?> map ); static String mapToString( Map<?, ?> map, String tabs ); @Deprecated static String toLowerCase( String value ); static String toLowerCaseAscii( String value ); static String toLowerCase( byte[] value ); @Deprecated static String toUpperCase( String value ); static String toUpperCaseAscii( String value ); static String upperCase( String str ); static String lowerCase( String str ); static String lowerCaseAscii( String str ); static boolean isPrintableString( String str ); static boolean isNotEmpty( String str ); static boolean isIA5String( String str ); static boolean isValidUuid( String uuid ); static String uuidToString( byte[] bytes ); static byte[] uuidToBytes( String string ); static byte[] copy( byte[] value ); static String getString( final byte[] data, int offset, int length, String charset ); static String getString( final byte[] data, int offset, int length, Charset charset ); static String getString( final byte[] data, String charset ); static String getString( final byte[] data, Charset charset ); static String getUUID( long value ); static int parseInt( String value ); static int compare( byte[] b1, byte[] b2 ); }
Strings { public static boolean areEquals( String string, int index, String text ) { if ( ( string == null ) || ( text == null ) ) { return false; } int length1 = string.length(); int length2 = text.length(); if ( ( length1 == 0 ) || ( length1 <= index ) || ( index < 0 ) || ( length2 == 0 ) || ( length2 > ( length1 + index ) ) ) { return false; } else { return string.substring( index ).startsWith( text ); } } private  Strings(); static String dumpBytes( byte[] buffer ); static String byteToString( byte b ); static String dumpByte( byte octet ); static char dumpHex( byte hex ); static String dumpHexPairs( byte[] buffer ); static String deepTrim( String str, boolean toLowerCase ); static String deepTrimToLower( String string ); static String deepTrim( String string ); static String trimConsecutiveToOne( String str, char ch ); static String centerTrunc( String str, int head, int tail ); static String toHexString( byte[] res ); static byte[] toByteArray( String hexString ); static String formatHtml( String source, boolean replaceNl, boolean replaceTag,
        boolean replaceQuote ); static boolean areEquals( String string, int index, String text ); static boolean isCharASCII( byte[] byteArray, int index, char car ); static boolean isCharASCII( char[] charArray, int index, char car ); static boolean isCharASCII( String string, int index, char car ); static String utf8ToString( byte[] bytes ); static String utf8ToString( byte[] bytes, int length ); static String utf8ToString( byte[] bytes, int start, int length ); static int areEquals( byte[] bytes, int index, String text ); static int areEquals( char[] chars, int index, String text ); static int areEquals( char[] chars, int index, String text, boolean caseSensitive ); static int areEquals( char[] chars, int index, char[] chars2 ); static int areEquals( char[] chars, int index, char[] chars2, boolean caseSensitive ); static int areEquals( byte[] bytes, int index, byte[] bytes2 ); static boolean isEmpty( String str ); static boolean isEmpty( byte[] bytes ); static String trim( String str ); static byte[] trim( byte[] bytes ); static String trimLeft( String str ); static int trimLeft( char[] chars, int pos ); static void trimLeft( String string, Position pos ); static void trimLeft( byte[] bytes, Position pos ); static int trimLeft( byte[] bytes, int pos ); static String trimRight( String str ); static String trimRight( String str, int escapedSpace ); static int trimRight( char[] chars, int pos ); static String trimRight( String string, Position pos ); static String trimRight( byte[] bytes, Position pos ); static int trimRight( byte[] bytes, int pos ); static char charAt( String string, int index ); static byte byteAt( byte[] bytes, int index ); static char charAt( char[] chars, int index ); static String asciiBytesToString( byte[] bytes ); static byte[] getBytesUtf8( String string ); static byte[] getBytesUtf8Ascii( String string ); static String getDefaultCharsetName(); static boolean equals( String str1, String str2 ); static String listToString( List<?> list ); static String setToString( Set<?> set ); static String listToString( List<?> list, String tabs ); static String mapToString( Map<?, ?> map ); static String mapToString( Map<?, ?> map, String tabs ); @Deprecated static String toLowerCase( String value ); static String toLowerCaseAscii( String value ); static String toLowerCase( byte[] value ); @Deprecated static String toUpperCase( String value ); static String toUpperCaseAscii( String value ); static String upperCase( String str ); static String lowerCase( String str ); static String lowerCaseAscii( String str ); static boolean isPrintableString( String str ); static boolean isNotEmpty( String str ); static boolean isIA5String( String str ); static boolean isValidUuid( String uuid ); static String uuidToString( byte[] bytes ); static byte[] uuidToBytes( String string ); static byte[] copy( byte[] value ); static String getString( final byte[] data, int offset, int length, String charset ); static String getString( final byte[] data, int offset, int length, Charset charset ); static String getString( final byte[] data, String charset ); static String getString( final byte[] data, Charset charset ); static String getUUID( long value ); static int parseInt( String value ); static int compare( byte[] b1, byte[] b2 ); static final byte[] HEX_CHAR; static final byte[] EMPTY_BYTES; static final String EMPTY_STRING; static final String[] EMPTY_STRING_ARRAY; }