public class StringUtil extends Object
a class to deal with the English stop char like the English punctuation
| Modifier and Type | Field and Description |
|---|---|
static int |
EN_LETTER |
static int |
EN_NUMERIC |
static int |
EN_PUNCTUATION |
static int |
EN_UNKNOW |
static int |
EN_WHITESPACE |
| Constructor and Description |
|---|
StringUtil() |
| Modifier and Type | Method and Description |
|---|---|
static int |
CJKIndexOf(String str) |
static int |
CJKIndexOf(String str,
int offset)
get the index of the first CJK char of the specified string
|
static String |
fwsTohws(String str)
a static method to replace the full-width char to the half-width char in a given string
(65281-65374 for full-width char)
|
static int |
getEnCharType(int u)
get the type of the English char
defined in this class and start with EN_.
|
static char |
getPunctuationPair(char c)
get the pair punctuation' pair
|
static String |
hwsTofws(String str)
a static method to replace the half-width char to the full-width char in a given string
|
static boolean |
isCJK(String str)
check if the specified string is all CJK chars
|
static boolean |
isCJK(String str,
int beginIndex,
int endIndex) |
static boolean |
isCJKChar(int c)
check the specified char is CJK, Thai...
|
static boolean |
isCnPunctuation(int c) |
static boolean |
isDecimal(String str)
check the specified char is a decimal including the full-width char
|
static boolean |
isDecimal(String str,
int beginIndex,
int endIndex) |
static boolean |
isDigit(String str)
check the specified char is a digit or not
true will return if it is or return false this method can recognize full-with char
|
static boolean |
isDigit(String str,
int beginIndex,
int endIndex) |
static boolean |
isEnChar(int c)
check the specified char is a basic Latin and Russia and
Greece letter.
|
static boolean |
isENKeepPunctuaton(char c)
check the given char is English keep punctuation
|
static boolean |
isEnLetter(int u)
include the full-width and half-width char
|
static boolean |
isEnNumeric(int u)
check the specified char is an English numeric(48-57)
including the full-width char
|
static boolean |
isEnPunctuation(int c)
check the given char is half-width punctuation
|
static boolean |
isFWEnChar(int c)
check the given char is a full-width char
AT+reader: the full-width punctuation is not included here
|
static boolean |
isHWEnChar(int c)
check the given char is a half-width char or not
|
static boolean |
isLatin(String str)
check if the specified string is all Latin chars
|
static boolean |
isLatin(String str,
int beginIndex,
int endIndex) |
static boolean |
isLetter(String str)
check if the specified string is Latin letter
|
static boolean |
isLetter(String str,
int beginIndex,
int endIndex) |
static boolean |
isLetterNumber(int c)
check the specified char is Letter number like 'ⅠⅡ'
true will be return if it is, or return false
|
static boolean |
isLetterOrNumeric(String str)
check if the specified string is Latin numeric or letter
|
static boolean |
isLetterOrNumeric(String str,
int beginIndex,
int endIndex) |
static boolean |
isLowerCaseLetter(int u) |
static boolean |
isNoTailingPunctuation(char c)
check if the given punctuation is the one that need to be cleared
|
static boolean |
isNumeric(String str)
check if the specified string it Latin numeric
|
static boolean |
isNumeric(String str,
int beginIndex,
int endIndex) |
static boolean |
isOtherNumber(int c)
check the specified char is other number like '①⑩⑽㈩'
true will be return if it is, or return false
|
static boolean |
isPairPunctuation(char c)
check the given char is pair punctuation or not
|
static boolean |
isUpperCaseLetter(int u) |
static boolean |
isWhitespace(int c)
check the given string is a whitespace
|
static int |
latinIndexOf(String str) |
static int |
latinIndexOf(String str,
int offset)
get the index of the first Latin char of the specified string
|
static int |
toLowerCase(int u) |
static int |
toUpperCase(int u) |
public static final int EN_LETTER
public static final int EN_NUMERIC
public static final int EN_PUNCTUATION
public static final int EN_WHITESPACE
public static final int EN_UNKNOW
public static boolean isCJKChar(int c)
c - public static boolean isEnChar(int c)
c - public static boolean isLetterNumber(int c)
c - public static boolean isOtherNumber(int c)
c - public static boolean isENKeepPunctuaton(char c)
c - public static boolean isNoTailingPunctuation(char c)
c - public static boolean isUpperCaseLetter(int u)
public static boolean isLowerCaseLetter(int u)
public static int toLowerCase(int u)
public static int toUpperCase(int u)
public static boolean isEnLetter(int u)
u - public static boolean isEnNumeric(int u)
u - public static int getEnCharType(int u)
u - char to identitypublic static boolean isHWEnChar(int c)
check the given char is a half-width char or not
c - public static boolean isFWEnChar(int c)
c - public static boolean isEnPunctuation(int c)
c - public static boolean isCnPunctuation(int c)
public static boolean isWhitespace(int c)
c - public static boolean isDigit(String str)
str - beginIndex - endIndex - public static boolean isDigit(String str, int beginIndex, int endIndex)
public static boolean isDecimal(String str)
str - beginIndex - endIndex - public static boolean isDecimal(String str, int beginIndex, int endIndex)
public static boolean isLatin(String str)
str - beginIndex - endIndex - public static boolean isLatin(String str, int beginIndex, int endIndex)
public static boolean isCJK(String str)
str - beginIndex - endIndex - public static boolean isCJK(String str, int beginIndex, int endIndex)
public static boolean isLetterOrNumeric(String str)
str - beginIndex - endIndex - public static boolean isLetterOrNumeric(String str, int beginIndex, int endIndex)
public static boolean isLetter(String str)
str - beginIndex - endIndex - public static boolean isLetter(String str, int beginIndex, int endIndex)
public static boolean isNumeric(String str)
str - beginIndex - endIndex - public static boolean isNumeric(String str, int beginIndex, int endIndex)
public static int latinIndexOf(String str, int offset)
str - offset - public static int latinIndexOf(String str)
public static int CJKIndexOf(String str, int offset)
str - offset - public static int CJKIndexOf(String str)
public static String fwsTohws(String str)
str - public static String hwsTofws(String str)
str - public static boolean isPairPunctuation(char c)
c - public static char getPunctuationPair(char c)
c - Copyright © 2017. All Rights Reserved.