java.lang.Character常用方法

+构造函数

Character(char value)
构造一个Character表示指定char值的新分配对象。

+方法

char charValue()
将此对象转化为char。

int hashCode()
返回此Character的哈希码。

boolean equals(Object obj)
将此对象与指定的对象进行比较。

int compareTo(Character anotherCharacter)
用Character数字比较两个对象。

String toString()
返回String表示此Character值的对象 。

+静态方法

static int charCount(int codePoint)
确定char表示指定字符所需的值的数量(Unicode代码点)。

static int codePointAt(char[] a, int index)
返回char数组给定索引处的代码点 。

static int codePointAt(char[] a, int index, int limit)
返回char数组给定索引处的代码点 ,其中只能使用索引index小于limit的数组元素。

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数组索引之前的代码点 ,其中只能使用索引index大于或等于start的数组元素 。

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)
返回指定char序列的文本范围内的Unicode代码点数。

static int compare(char x, char y)
以char数字方式比较两个值。

static int digit(char ch, int radix)
返回ch指定基数中字符的数值。
radix的取值范围[2,36]
如果ch是“大写”的A到Z之间,则返回(ch - 'A' + 10)的值;如果是“小写”a到z之间,返回(ch - 'a' + 10)的值
如:求16进制中F代表的是多少,System.out.println(Character.digit('F',16));// 结果:15

static int digit(int codePoint, int radix)
返回指定基数中指定字符(Unicode代码点)的数值。

static char forDigit(int digit, int radix)
确定指定计算机进制(radix)中特定数字的字符表示形式。
radix的返回[2,36]
digit的取值范围[0,radix)
如:求在16进制中15使用哪个字符标识,System.out.println(Character.forDigit(15,16))// 结果:f

static byte getDirectionality(char ch)
返回给定字符的Unicode方向性属性。

static byte getDirectionality(int codePoint)
返回给定字符的Unicode方向性属性(Unicode代码点)。

static String getName(int codePoint)
返回指定字符的Unicode名称,codePoint如果代码点为null,则返回 null unassigned。

static int getNumericValue(char ch)
返回指定的Unicode字符表示的int值。

static int getNumericValue(int codePoint)
返回指定字符(Unicode代码点)表示的值int。

static int getType(char ch)
返回表示字符常规类别的值。

static int getType(int codePoint)
返回表示字符常规类别的值。

static int hashCode(char value)
返回char值的哈希码; 兼容 Character.hashCode()。

static char highSurrogate(int codePoint)
返回表示UTF-16编码中指定的补充字符(Unicode代码点)的代理对的前导代理( 高代理代码单元) 。

static boolean isHighSurrogate(char ch)
确定给定char值是否为 Unicode高代理代码单元 (也称为前导代理代码单元)。

static boolean isAlphabetic(int codePoint)
确定指定的字符(Unicode代码点)是否为字母。

static boolean isBmpCodePoint(int codePoint)
确定指定的字符(Unicode代码点)是否在基本多语言平面(BMP)中。

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 isIdentifierIgnorable(char ch)
确定指定的字符是否应被视为Java标识符或Unicode标识符中的可忽略字符。

static boolean isIdentifierIgnorable(int codePoint)
确定指定的字符(Unicode代码点)是否应被视为Java标识符或Unicode标识符中的可忽略字符。

static boolean isIdeographic(int codePoint)
确定指定的字符(Unicode代码点)是否是Unicode标准定义的CJKV(中文,日文,韩文和越南文)表意文字。

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 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值是否为Unicode低代理代码单元 (也称为trailing-surrogate代码单元)。

static boolean isMirrored(char ch)
确定是否根据Unicode规范镜像该字符。

static boolean isMirrored(int codePoint)
确定是否根据Unicode规范镜像指定的字符(Unicode代码点)。

static boolean isSpaceChar(char ch)
确定指定的字符是否为Unicode空格字符。

static boolean isSpaceChar(int codePoint)
确定指定的字符(Unicode代码点)是否为Unicode空格字符。

static boolean isSupplementaryCodePoint(int codePoint)
确定指定的字符(Unicode代码点)是否在补充字符范围内。

static boolean isSurrogate(char ch)
确定给定char值是否为Unicode代理项代码单元。

static boolean isSurrogatePair(char high, char low)
确定指定的char值对是否是有效的Unicode代理项对。

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)
确定指定的代码点是否是有效的Unicode代码点值。

static boolean isWhitespace(char ch)
根据Java确定指定的字符是否为空白。

static boolean isWhitespace(int codePoint)
根据Java确定指定的字符(Unicode代码点)是否为空白。

static char lowSurrogate(int codePoint)
判断给定char值是Unicode低代理项代码单元(也称为尾部代理项代码单元)。这样的值并不代表字符本身,而是在UTF-16编码的补充的字符表示被使用

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)
返回给定char序列中与代码点给定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代码点)参数转换为小写。

static String toString(char c)
返回String表示指定对象的对象char。

static char toTitleCase(char ch)
使用UnicodeData文件中的大小写映射信息将字符参数转换为titlecase。(转化为大小)

static int toTitleCase(int codePoint)
使用UnicodeData文件中的案例映射信息将字符(Unicode代码点)参数转换为titlecase。(转化为大小)

static char toUpperCase(char ch)
使用UnicodeData文件中的大小写映射信息将字符参数转换为大写。

static int toUpperCase(int codePoint)
使用UnicodeData文件中的大小写映射信息将字符(Unicode代码点)参数转换为大写。

static Character valueOf(char c)
返回表示指定char值的Character实例 。

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

书香水墨

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值