static int charCount(int codePoint)
確定表示指定字符(Unicode 代碼點)所需的 char 值的數量。
char charValue()
返回此 Character 對象的值。
static int codePointAt(char[] a, int index)
返回 char 數組的給定索引上的代碼點。
static int codePointAt(char[] a, int index, int limit)
返回 char 數組的給定索引上的代碼點,該數組中只有那些具有小於 limit 的 index 值的數組元素可以使用。
static int codePointAt(CharSequence seq, int index)
返回 CharSequence 的給定索引上的代碼點。
static int codePointBefore(char[] a, int index)
返回 char 數組的給定索引前面的代碼點。
static int codePointBefore(char[] a, int index, int start)
返回 char 數組的給定索引前面的代碼點,該數組中只有那些具有大於等於 start 的 index 值的數組元素可以使用。
static int codePointBefore(CharSequence seq, int index)
返回 CharSequence 的給定索引前面的代碼點。
static int codePointCount(char[] a, int offset, int count)
返回 char 數組參數的子數組中 Unicode 代碼點的數量。
static int codePointCount(CharSequence seq, int beginIndex, int endIndex)
返回指定字符序列的文本範圍內的 Unicode 代碼點數量。
int compareTo(Character anotherCharacter)
根據數字比較兩個 Character 對象。
static int digit(char ch, int radix)
返回使用指定基數的字符 ch 的數值。
static int digit(int codePoint, int radix)
返回使用指定基數的指定字符(Unicode 代碼點)的數值。
boolean equals(Object obj)
將此對象與指定對象比較。
static char forDigit(int digit, int radix)
確定使用指定基數的特定數字的字符表示形式。
static byte getDirectionality(char ch)
返回給定字符的 Unicode 方向屬性。
static byte getDirectionality(int codePoint)
返回給定字符(Unicode 代碼點)的 Unicode 方向屬性。
static int getNumericValue(char ch)
返回指定的 Unicode 字符表示的 int 值。
static int getNumericValue(int codePoint)
返回指定字符(Unicode 代碼點)表示的 int 值。
static int getType(char ch)
返回壹個指示字符的常規類別的值。
static int getType(int codePoint)
返回壹個指示字符的常規類別的值。
int hashCode()
返回此 Character 的哈希碼。
static boolean isDefined(char ch)
確定字符是否被定義為 Unicode 中的字符。
static boolean isDefined(int codePoint)
確定字符(Unicode 代碼點)是否被定義為 Unicode 中的字符。
static boolean isDigit(char ch)
確定指定字符是否為數字。
static boolean isDigit(int codePoint)
確定指定字符(Unicode 代碼點)是否為數字。
static boolean isHighSurrogate(char ch)
確定給出的 char 值是否為壹個高代理項代碼單元(也稱為前導代理項代碼單元)。
static boolean isIdentifierIgnorable(char ch)
確定是否應該認為指定字符是 Java 標識符或 Unicode 標識符中可忽略的壹個字符。
static boolean isIdentifierIgnorable(int codePoint)
確定是否應該認為指定字符(Unicode 代碼點)是 Java 標識符或 Unicode 標識符中可忽略的壹個字符。
static boolean isISOControl(char ch)
確定指定字符是否為 ISO 控制字符。
static boolean isISOControl(int codePoint)
確定引用的字符(Unicode 代碼點)是否為 ISO 控制字符。
static boolean isJavaIdentifierPart(char ch)
確定指定字符是否可以是 Java 標識符中首字符以外的部分。
static boolean isJavaIdentifierPart(int codePoint)
確定字符(Unicode 代碼點)是否可以是 Java 標識符中首字符以外的部分。
static boolean isJavaIdentifierStart(char ch)
確定是否允許將指定字符作為 Java 標識符中的首字符。
static boolean isJavaIdentifierStart(int codePoint)
確定是否允許將字符(Unicode 代碼點)作為 Java 標識符中的首字符。
static boolean isJavaLetter(char ch)
已過時。 由 isJavaIdentifierStart(char) 取代。
static boolean isJavaLetterOrDigit(char ch)
已過時。 由 isJavaIdentifierPart(char) 取代。
static boolean isLetter(char ch)
確定指定字符是否為字母。
static boolean isLetter(int codePoint)
確定指定字符(Unicode 代碼點)是否為字母。
static boolean isLetterOrDigit(char ch)
確定指定字符是否為字母或數字。
static boolean isLetterOrDigit(int codePoint)
確定指定字符(Unicode 代碼點)是否為字母或數字。
static boolean isLowerCase(char ch)
確定指定字符是否為小寫字母。
static boolean isLowerCase(int codePoint)
確定指定字符(Unicode 代碼點)是否為小寫字母。
static boolean isLowSurrogate(char ch)
確定給定 char 值是否壹個低代理項代碼單元(也稱為尾部代理項代碼單元)。
static boolean isMirrored(char ch)
確定指定字符依據 Unicode 規範是否對稱。
static boolean isMirrored(int codePoint)
確定指定字符(Unicode 代碼點)依據 Unicode 規範是否對稱。
static boolean isSpace(char ch)
已過時。 由 isWhitespace(char) 取代。
static boolean isSpaceChar(char ch)
確定指定字符是否為 Unicode 空白字符。
static boolean isSpaceChar(int codePoint)
確定指定字符(Unicode 代碼點)是否為 Unicode 空白字符。
static boolean isSupplementaryCodePoint(int codePoint)
確定指定字符(Unicode 代碼點)是否在增補字符範圍內。
static boolean isSurrogatePair(char high, char low)
確定指定的 char 值對是否為有效的代理項對。
static boolean isTitleCase(char ch)
確定指定字符是否為首字母大寫字符。
static boolean isTitleCase(int codePoint)
確定指定字符(Unicode 代碼點)是否為首字母大寫字符。
static boolean isUnicodeIdentifierPart(char ch)
確定指定字符是否可以是 Unicode 標識符中首字符以外的部分。
static boolean isUnicodeIdentifierPart(int codePoint)
確定指定字符(Unicode 代碼點)是否可以是 Unicode 標識符中首字符以外的部分。
static boolean isUnicodeIdentifierStart(char ch)
確定是否允許將指定字符作為 Unicode 標識符中的首字符。
static boolean isUnicodeIdentifierStart(int codePoint)
確定是否允許將指定字符(Unicode 代碼點)作為 Unicode 標識符中的首字符。
static boolean isUpperCase(char ch)
確定指定字符是否為大寫字母。
static boolean isUpperCase(int codePoint)
確定指定字符(Unicode 代碼點)是否為大寫字母。
static boolean isValidCodePoint(int codePoint)
確定指定的代碼點是否為從 0x0000 到 0x10FFFF 範圍之內的有效 Unicode 代碼點值。
static boolean isWhitespace(char ch)
確定指定字符依據 Java 標準是否為空白字符。
static boolean isWhitespace(int codePoint)
確定指定字符(Unicode 代碼點)依據 Java 標準是否為空白字符。
static int offsetByCodePoints(char[] a, int start, int count, int index, int codePointOffset)
返回給定 char 子數組中的索引,它是從給定 index 到 codePointOffset 代碼點的偏移量。
static int offsetByCodePoints(CharSequence seq, int index, int codePointOffset)
返回給定字符序列中的索引,它是從給定 index 到 codePointOffset 代碼點的偏移量。
static char reverseBytes(char ch)
返回通過反轉指定 char 值中的字節順序而獲得的值。
static char[] toChars(int codePoint)
將指定的字符(Unicode 代碼點)轉換成其存儲在 char 數組中的 UTF-16 表示形式。
static int toChars(int codePoint, char[] dst, int dstIndex)
將指定字符(Unicode 代碼點)轉換為其 UTF-16 表示形式。
static int toCodePoint(char high, char low)
將指定的代理項對轉換為其增補代碼點值。
static char toLowerCase(char ch)
使用取自 UnicodeData 文件的大小寫映射信息將字符參數轉換為小寫。
static int toLowerCase(int codePoint)
使用取自 UnicodeData 文件的大小寫映射信息將字符(Unicode 代碼點)參數轉換為小寫。
String toString()
返回表示此 Character 值的 String 對象。
static String toString(char c)
返回壹個表示指定 char 值的 String 對象。
static char toTitleCase(char ch)
使用取自 UnicodeData 文件的大小寫映射信息將字符參數轉換為首字母大寫。
static int toTitleCase(int codePoint)
使用取自 UnicodeData 文件的大小寫映射信息將字符(Unicode 代碼點)參數轉換為首字母大寫。
static char toUpperCase(char ch)
使用取自 UnicodeData 文件的大小寫映射信息將字符參數轉換為大寫。
static int toUpperCase(int codePoint)
使用取自 UnicodeData 文件的大小寫映射信息將字符(Unicode 代碼點)參數轉換為大寫。
static Character valueOf(char c)
返回壹個表示指定 char 值的 Character 實例
string所有方法:
char charAt(int index)
返回指定索引處的 char 值。
int codePointAt(int index)
返回指定索引處的字符(Unicode 代碼點)。
int codePointBefore(int index)
返回指定索引之前的字符(Unicode 代碼點)。
int codePointCount(int beginIndex, int endIndex)
返回此 String 的指定文本範圍中的 Unicode 代碼點數。
int compareTo(String anotherString)
按字典順序比較兩個字符串。
int compareToIgnoreCase(String str)
按字典順序比較兩個字符串,不考慮大小寫。
String concat(String str)
將指定字符串連接到此字符串的結尾。
boolean contains(CharSequence s)
當且僅當此字符串包含指定的 char 值序列時,返回 true。
boolean contentEquals(CharSequence cs)
將此字符串與指定的 CharSequence 比較。
boolean contentEquals(StringBuffer sb)
將此字符串與指定的 StringBuffer 比較。
static String copyValueOf(char[] data)
返回指定數組中表示該字符序列的 String。
static String copyValueOf(char[] data, int offset, int count)
返回指定數組中表示該字符序列的 String。
boolean endsWith(String suffix)
測試此字符串是否以指定的後綴結束。
boolean equals(Object anObject)
將此字符串與指定的對象比較。
boolean equalsIgnoreCase(String anotherString)
將此 String 與另壹個 String 比較,不考慮大小寫。
static String format(Locale l, String format, Object... args)
使用指定的語言環境、格式字符串和參數返回壹個格式化字符串。
static String format(String format, Object... args)
使用指定的格式字符串和參數返回壹個格式化字符串。
byte[] getBytes()
使用平臺的默認字符集將此 String 編碼為 byte 序列,並將結果存儲到壹個新的 byte 數組中。
byte[] getBytes(Charset charset)
使用給定的 charset 將此 String 編碼到 byte 序列,並將結果存儲到新的 byte 數組。
void getBytes(int srcBegin, int srcEnd, byte[] dst, int dstBegin)
已過時。 該方法無法將字符正確轉換為字節。從 JDK 1.1 起,完成該轉換的首選方法是通過 getBytes() 方法,該方法使用平臺的默認字符集。
byte[] getBytes(String charsetName)
使用指定的字符集將此 String 編碼為 byte 序列,並將結果存儲到壹個新的 byte 數組中。
void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
將字符從此字符串復制到目標字符數組。
int hashCode()
返回此字符串的哈希碼。
int indexOf(int ch)
返回指定字符在此字符串中第壹次出現處的索引。
int indexOf(int ch, int fromIndex)
返回在此字符串中第壹次出現指定字符處的索引,從指定的索引開始搜索。
int indexOf(String str)
返回指定子字符串在此字符串中第壹次出現處的索引。
int indexOf(String str, int fromIndex)
返回指定子字符串在此字符串中第壹次出現處的索引,從指定的索引開始。
String intern()
返回字符串對象的規範化表示形式。
boolean isEmpty()
當且僅當 length() 為 0 時返回 true。
int lastIndexOf(int ch)
返回指定字符在此字符串中最後壹次出現處的索引。
int lastIndexOf(int ch, int fromIndex)
返回指定字符在此字符串中最後壹次出現處的索引,從指定的索引處開始進行反向搜索。
int lastIndexOf(String str)
返回指定子字符串在此字符串中最右邊出現處的索引。
int lastIndexOf(String str, int fromIndex)
返回指定子字符串在此字符串中最後壹次出現處的索引,從指定的索引開始反向搜索。
int length()
返回此字符串的長度。
boolean matches(String regex)
告知此字符串是否匹配給定的正則表達式。
int offsetByCodePoints(int index, int codePointOffset)
返回此 String 中從給定的 index 處偏移 codePointOffset 個代碼點的索引。
boolean regionMatches(boolean ignoreCase, int toffset, String other, int ooffset, int len)
測試兩個字符串區域是否相等。
boolean regionMatches(int toffset, String other, int ooffset, int len)
測試兩個字符串區域是否相等。
String replace(char oldChar, char newChar)
返回壹個新的字符串,它是通過用 newChar 替換此字符串中出現的所有 oldChar 得到的。
String replace(CharSequence target, CharSequence replacement)
使用指定的字面值替換序列替換此字符串所有匹配字面值目標序列的子字符串。
String replaceAll(String regex, String replacement)
使用給定的 replacement 替換此字符串所有匹配給定的正則表達式的子字符串。
String replaceFirst(String regex, String replacement)
使用給定的 replacement 替換此字符串匹配給定的正則表達式的第壹個子字符串。
String[] split(String regex)
根據給定正則表達式的匹配拆分此字符串。
String[] split(String regex, int limit)
根據匹配給定的正則表達式來拆分此字符串。
boolean startsWith(String prefix)
測試此字符串是否以指定的前綴開始。
boolean startsWith(String prefix, int toffset)
測試此字符串從指定索引開始的子字符串是否以指定前綴開始。
CharSequence subSequence(int beginIndex, int endIndex)
返回壹個新的字符序列,它是此序列的壹個子序列。
String substring(int beginIndex)
返回壹個新的字符串,它是此字符串的壹個子字符串。
String substring(int beginIndex, int endIndex)
返回壹個新字符串,它是此字符串的壹個子字符串。
char[] toCharArray()
將此字符串轉換為壹個新的字符數組。
String toLowerCase()
使用默認語言環境的規則將此 String 中的所有字符都轉換為小寫。
String toLowerCase(Locale locale)
使用給定 Locale 的規則將此 String 中的所有字符都轉換為小寫。
String toString()
返回此對象本身(它已經是壹個字符串!)。
String toUpperCase()
使用默認語言環境的規則將此 String 中的所有字符都轉換為大寫。
String toUpperCase(Locale locale)
使用給定 Locale 的規則將此 String 中的所有字符都轉換為大寫。
String trim()
返回字符串的副本,忽略前導空白和尾部空白。
static String valueOf(boolean b)
返回 boolean 參數的字符串表示形式。
static String valueOf(char c)
返回 char 參數的字符串表示形式。
static String valueOf(char[] data)
返回 char 數組參數的字符串表示形式。
static String valueOf(char[] data, int offset, int count)
返回 char 數組參數的特定子數組的字符串表示形式。
static String valueOf(double d)
返回 double 參數的字符串表示形式。
static String valueOf(float f)
返回 float 參數的字符串表示形式。
static String valueOf(int i)
返回 int 參數的字符串表示形式。
static String valueOf(long l)
返回 long 參數的字符串表示形式。
static String valueOf(Object obj)
返回 Object 參數的字符串表示形式