Here you can find the source of endsWithSingleQuoteS(String s)
Parameter | Description |
---|---|
s | String to check for ending with single quote + s. |
public static boolean endsWithSingleQuoteS(String s)
//package com.java2s; /* Please see the license information at the end of this file. */ public class Main { /** Left single curly quote. */ public static final char LSQUOTE = '\u2018'; /** Right single curly quote. */ public static final char RSQUOTE = '\u2019'; /** True if string ends with "single quote + s". *//from w ww. j ava2 s . c o m * @param s String to check for ending with single quote + s. * * @return true if token ends with single quote + s. */ public static boolean endsWithSingleQuoteS(String s) { int l = s.length(); return (l > 1) && ((s.charAt(l - 1) == 's') || (s.charAt(l - 1) == 'S')) && isSingleQuote(s.charAt(l - 2)); } /** True if character is single quote. * * @param c Character to check for being a single quote. * * @return true if character is a single quote. */ public static boolean isSingleQuote(char c) { return (c == '\'') || (c == LSQUOTE) || (c == RSQUOTE); } }