Here you can find the source of endsWithWhitespace(final CharSequence charSeq)
public static boolean endsWithWhitespace(final CharSequence charSeq)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w . ja v a 2 s. c om*/ * Finds out if the given character sequence ends with a whitespace * character. * * @return {@code true} if the given character sequence is not empty * and ends with a whitespace character; {@code false} otherwise * @exception NullPointerException if the given character sequence is * {@code null} */ public static boolean endsWithWhitespace(final CharSequence charSeq) { if (charSeq.length() == 0) { return false; } return Character.isWhitespace(charSeq.charAt(charSeq.length() - 1)); } }