Here you can find the source of endsWithSpaces(final String text)
private static boolean endsWithSpaces(final String text)
//package com.java2s; /****************************************************************************** * Copyright (c) 2015 Oracle/*from ww w. j a v a 2s . c o m*/ * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Ling Hao - initial implementation and ongoing maintenance * Konstantin Komissarchik - [333782] Problems in whitespace handling ******************************************************************************/ public class Main { private static boolean endsWithSpaces(final String text) { final char ch = text.charAt(text.length() - 1); return Character.isWhitespace(ch); } }