Here you can find the source of endsWithSpace(String s)
public static boolean endsWithSpace(String s)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean endsWithSpace(String s) { if (s != null && s.length() > 0) { char last = s.charAt(s.length() - 1); if (last == ' ') return true; }// w w w . ja v a2 s. c o m return false; } }