public class CharConverts extends Object
Modifier and Type | Method and Description |
---|---|
static String |
convertControlCodeToUnicode(String str)
转换控制字符 unicode
|
static String |
fromHex(String str)
hex -> char
%xx -> xx
|
static byte[] |
fromHexByte(String str)
hex -> byte
%xx -> xx
|
static String |
fromHtmlEntity(String value)
html entity -> char
xx; -> xx
|
static String |
fromUnicode(String str)
unicode -> str
\\u -> xx
|
static char |
fromUnicodeChar(String str)
unicode -> char
\\u -> xx
|
static String |
toHex(byte[] bs)
byte -> hex
xx -> %xx
|
static String |
toHex(String str)
str -> hex
xx -> %xx
|
static String |
toHtmlEntity(String str)
char -> html entity
xx -> xx;
|
static String |
toUnicode(String str) |
static String |
toUnicode(String str,
boolean convertNumber)
char -> unicode
xx -> \\u
|
static String |
toUnicodeChar(char c)
char -> unicode
xx -> \\u
|
public static String toHtmlEntity(String str)
str
- charpublic static String fromHtmlEntity(String value)
value
- html entitypublic static String toUnicode(String str, boolean convertNumber)
str
- strconvertNumber
- 是否转换字母和数字public static String toUnicodeChar(char c)
c
- charpublic static String fromUnicode(String str)
str
- unicodepublic static char fromUnicodeChar(String str)
str
- unicodepublic static String toHex(String str)
str
- strpublic static String toHex(byte[] bs)
bs
- bytepublic static String fromHex(String str)
str
- hexpublic static byte[] fromHexByte(String str)
str
- hexCopyright © 2024. All rights reserved.