Java String Ends With endsWithStop(String str)

Here you can find the source of endsWithStop(String str)

Description

Ends with stop.

License

Open Source License

Parameter

Parameter Description
str the string

Return

true, if this token is ended with stop '.'

Declaration

public static boolean endsWithStop(String str) 

Method Source Code

//package com.java2s;
/*//from   ww w . j av a 2s  .co m
 Copyright (C) 2010 by
 * 
 *    Cam-Tu Nguyen 
 *  ncamtu@ecei.tohoku.ac.jp or ncamtu@gmail.com
 *
 *  Xuan-Hieu Phan  
 *  pxhieu@gmail.com 
 *
 *  College of Technology, Vietnamese University, Hanoi
 *    Graduate School of Information Sciences, Tohoku University
 *
 * JVnTextPro-v.2.0 is a free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * by the Free Software Foundation; either version 2 of the License,
 * or (at your option) any later version.
 *
 * JVnTextPro-v.2.0 is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with  JVnTextPro-v.2.0); if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 */

public class Main {
    /**
     * Ends with stop.
     *
     * @param str the string
     * @return true, if this token is ended with stop '.'
     */
    public static boolean endsWithStop(String str) {
        if (str.endsWith(".") || str.endsWith("?") || str.endsWith("!")) {
            return true;
        }

        return false;
    }
}

Related

  1. endsWithSomeChar(char cs[], String activationToken)
  2. endsWithSpace(String s)
  3. endsWithSpaces(final String text)
  4. endsWithStarsPattern(String text, int from)
  5. endsWithStartOfOther(String text, String textOther)
  6. endsWithWhitespace(final CharSequence charSeq)
  7. endsWithWhitespace(String s)
  8. endsWithWord(StringBuffer strBuf, int endIndex, int lastSpaceIndex)