public final class Ascii extends Object
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static char |
NUL |
ASCII null control character:
00 '\0' (NUL) |
| 限定符 | 构造器 | 说明 |
|---|---|---|
private |
Ascii() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static int[] |
countCases(CharSequence str) |
Counts how many times the upper letter and lower letter and not letter occurrences in the given string.
|
static boolean |
isAscii(char c) |
Whether the character is an ASCII character
|
static boolean |
isControlAscii(char c) |
Whether the character is a Control ASCII character
|
static boolean |
isLetter(char c) |
Whether the character is a Letter (
a-z,A-Z) |
static boolean |
isNumber(char c) |
Whether the character is a Number (
0-9) |
static boolean |
isPrintableAscii(char c) |
Whether the character is a Printable ASCII character
|
static char |
toLower(char c) |
Convert uppercase character to lowercase
|
static String |
toLower(String str) |
Convert all uppercase characters to lowercase
|
static String |
toLowerFirstChar(String str) |
Convert first character in String to Lower.
|
static char |
toUpper(char c) |
Convert lowercase character to uppercase
|
static String |
toUpper(String str) |
Convert all lowercase characters to uppercase
|
static String |
toUpperFirstChar(String str) |
Convert first character in String to Upper.
|
static int |
upperOrLowerOrNot(char c) |
Indicates the character is a Upper ASCII Letter (
A-Z)
or Lower ASCII Letter (a-z)
or Not ASCII Letter. |
public static final char NUL
00 '\0' (NUL)public static boolean isAscii(char c)
c - input charactertrue if character is an ASCII, otherwise, return falsepublic static boolean isPrintableAscii(char c)
c - input charactertrue if character is a Printable ASCII, otherwise, return falsepublic static boolean isControlAscii(char c)
c - input charactertrue if character is a Control ASCII, otherwise, return falsepublic static boolean isLetter(char c)
a-z,A-Z)c - input charactertrue if character is a Letter (a-z,A-Z), otherwise, return falsepublic static boolean isNumber(char c)
0-9)c - input charactertrue if character is a Number (0-9), otherwise, return falsepublic static int upperOrLowerOrNot(char c)
A-Z)
or Lower ASCII Letter (a-z)
or Not ASCII Letter. a-z);
A-Z).
c - input charactera-z);
A-Z).
public static char toUpper(char c)
c - input characterpublic static char toLower(char c)
c - input characterpublic static String toUpper(String str)
str - stringpublic static String toLower(String str)
str - stringpublic static String toUpperFirstChar(String str)
str - stringpublic static String toLowerFirstChar(String str)
str - stringpublic static int[] countCases(CharSequence str)
Examples:
Ascii.countCases("$%^678 AblkjAE hhByyZ"); // returns [5, 8, 8];
// upperCount: 5, lowerCount: 8, notLetterCount: 8
str - stringint[]{upperCount, lowerCount, notLetterCount}Copyright © 2023 io-fairy. All rights reserved.