Here you can find the source of endsWithChar(final String s, final char c)
public static boolean endsWithChar(final String s, final char c)
//package com.java2s; public class Main { public static boolean endsWithChar(final String s, final char c) { if (s == null || s.length() == 0) { return false; }//from w w w . j a va2 s .c o m return s.charAt(s.length() - 1) == c; } }