public static boolean commonSuffixOfLength ( String s , String p , int len ) { return s != null && p != null && len >= 0 && s . regionMatches ( s . length ( ) - len , p , p . length ( ) - len , len ) ; }
Checks if two strings have the same suffix of specified length