Here you can find the source of suffix(String str, String suf)
static boolean suffix(String str, String suf)
//package com.java2s; public class Main { static boolean suffix(String str, String suf) { return (str.length() >= suf.length()) && (str.substring(str.length() - suf.length(), str.length()).equals(suf)); }//from ww w .j a v a2s. co m }