Here you can find the source of endsWith(StringBuilder sb, String end)
public static boolean endsWith(StringBuilder sb, String end)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean endsWith(StringBuilder sb, String end) { int i = sb.indexOf(end, sb.length() - end.length()); return i != -1; }/*from www . j av a 2 s .c o m*/ }