public class Chars extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
CR
\r 回车
|
static int |
LF
\n 换行符
|
static int |
SPACE
' ' 空格
|
static int |
TAB
\t tab 键
|
| 限定符和类型 | 方法和说明 |
|---|---|
static char |
b2c(byte b) |
static byte |
c2b(char c) |
static int |
compare(char x,
char y)
Compares two
char values numerically. |
static char |
from(int i) |
static boolean |
isAlphabetic(int codePoint)
Determines if the specified character (Unicode code point) is an alphabet.
|
static boolean |
isAscii(char ch) |
static boolean |
isAsciiPrintable(char ch) |
static boolean |
isCRorLF(char ch) |
static boolean |
isLowerCase(byte value) |
static boolean |
isLowerCase(char value) |
static boolean |
isLowOrUpperCase(byte value) |
static boolean |
isLowOrUpperCase(char value) |
static boolean |
isNotCRAndLF(char ch) |
static boolean |
isNumber(char c) |
static boolean |
isUpperCase(byte value) |
static boolean |
isUpperCase(char value) |
static boolean |
isWhitespace(char ch) |
static int |
toInt(char c) |
static byte |
toLowerCase(byte c) |
static char |
toLowerCase(char c) |
static byte |
toUpperCase(byte b) |
static char |
toUpperCase(char b) |
static byte[] |
toUtf8Bytes(char[] chars)
Encodes the provided char[] to a UTF-8 byte[].
|
static char[] |
utf8BytesToChars(byte[] utf8Bytes)
Decodes the provided byte[] to a UTF-8 char[].
|
public static final int CR
public static final int LF
public static final int SPACE
public static final int TAB
public static boolean isAlphabetic(int codePoint)
A character is considered to be alphabetic if its general category type,
provided by getType(codePoint), is any of
the following:
UPPERCASE_LETTER
LOWERCASE_LETTER
TITLECASE_LETTER
MODIFIER_LETTER
OTHER_LETTER
LETTER_NUMBER
codePoint - the character (Unicode code point) to be tested.true if the character is a Unicode alphabet
character, false otherwise.
copy from java 1.7 Character.isAlphabetic
public static boolean isAscii(char ch)
public static boolean isAsciiPrintable(char ch)
public static boolean isNumber(char c)
public static int toInt(char c)
public static char from(int i)
public static char toLowerCase(char c)
public static byte toLowerCase(byte c)
public static byte toUpperCase(byte b)
public static char toUpperCase(char b)
public static boolean isLowerCase(byte value)
public static boolean isLowerCase(char value)
public static boolean isUpperCase(byte value)
public static boolean isUpperCase(char value)
public static boolean isLowOrUpperCase(char value)
public static boolean isLowOrUpperCase(byte value)
public static byte c2b(char c)
public static char b2c(byte b)
public static int compare(char x,
char y)
Compares two char values numerically. This is the same functionality as provided in Java 7.
x - the first char to comparey - the second char to compare0 if x == y;
a value less than 0 if x < y; and
a value greater than 0 if x > ypublic static boolean isWhitespace(char ch)
public static boolean isCRorLF(char ch)
public static boolean isNotCRAndLF(char ch)
public static char[] utf8BytesToChars(byte[] utf8Bytes)
public static byte[] toUtf8Bytes(char[] chars)
Copyright © 2021. All rights reserved.