Java String Ends With endsWithWord(StringBuffer strBuf, int endIndex, int lastSpaceIndex)

Here you can find the source of endsWithWord(StringBuffer strBuf, int endIndex, int lastSpaceIndex)

Description

This method checks for the end Index value and returns true if it matches.

License

Open Source License

Parameter

Parameter Description
strBuf a parameter
endIndex a parameter
lastSpaceIndex a parameter

Return

boolean

Declaration

private static boolean endsWithWord(StringBuffer strBuf, int endIndex, int lastSpaceIndex) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from  w ww.j  av  a2 s .c  o  m*/
     * This method checks for the end Index value and returns true if it
     * matches.
     * 
     * @param strBuf
     * @param endIndex
     * @param lastSpaceIndex
     * @return boolean
     */
    private static boolean endsWithWord(StringBuffer strBuf, int endIndex, int lastSpaceIndex) {
        return ((lastSpaceIndex == (endIndex - 1)) || (strBuf.charAt(endIndex) == ' '));
    }
}

Related

  1. endsWithStarsPattern(String text, int from)
  2. endsWithStartOfOther(String text, String textOther)
  3. endsWithStop(String str)
  4. endsWithWhitespace(final CharSequence charSeq)
  5. endsWithWhitespace(String s)