Java String Ends With endsWithSpaces(final String text)

Here you can find the source of endsWithSpaces(final String text)

Description

ends With Spaces

License

Open Source License

Declaration

private static boolean endsWithSpaces(final String text) 

Method Source Code

//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);
    }
}

Related

  1. endsWithSeparator(String str)
  2. endsWithSingleQuoteS(String s)
  3. endsWithSlash(final String path)
  4. endsWithSomeChar(char cs[], String activationToken)
  5. endsWithSpace(String s)
  6. endsWithStarsPattern(String text, int from)
  7. endsWithStartOfOther(String text, String textOther)
  8. endsWithStop(String str)
  9. endsWithWhitespace(final CharSequence charSeq)