博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Java Character.UnicodeBlock of()方法与示例
阅读量:2530 次
发布时间:2019-05-11

本文共 2306 字,大约阅读时间需要 7 分钟。

Character.UnicodeBlock类的()方法 (Character.UnicodeBlock Class of() method)

  • of() method is available in java.lang package.

    of()方法在java.lang包中可用。

  • of() method is used to return the Unicode block containing the given parameter value or it returns null when the given char value is not a part of a defined Unicode Block.

    of()方法用于返回包含给定参数值的Unicode块,或者在给定char值不属于已定义Unicode块的一部分时返回null。

  • of() method is a static method, it is accessible with the class name and if we try to access the method with the class object then we will not get any error.

    of()方法是一个静态方法,可以使用类名进行访问,如果尝试使用类对象访问该方法,则不会出现任何错误。

  • of() method does not throw an exception at the time of returning Unicode block.

    of()方法在返回Unicode块时不会引发异常。

Syntax:

句法:

public static Character.UnicodeBlock of(Char value);

Parameter(s):

参数:

  • Char value – represents the character value.

    字符值 –表示字符值。

Return value:

返回值:

The return type of this method is Character.UnicodeBlock, it returns the following values based on the given cases,

此方法的返回类型为Character.UnicodeBlock ,它基于给定的情况返回以下值,

  • It returns the Unicode Block when the given char value is a part of any defined Unicode block.

    当给定的char值是任何已定义的Unicode块的一部分时,它将返回Unicode块。

  • It returns null when the given char value is not a part of any defined Unicode code block.

    当给定的char值不属于任何已定义的Unicode代码块时,它返回null。

Example:

例:

// Java program to demonstrate the example // of Character.UnicodeBlock of(Char value)// method of Character.UnicodeBlock classpublic class Of {
public static void main(String args[]) {
// By using of(Char ch) method is to return the UnicodeBlock name // containing the given char value Character.UnicodeBlock ub1 = Character.UnicodeBlock.of('+'); Character.UnicodeBlock ub2 = Character.UnicodeBlock.of('u'); Character.UnicodeBlock ub3 = Character.UnicodeBlock.of('/'); Character.UnicodeBlock ub4 = Character.UnicodeBlock.of('a'); Character.UnicodeBlock ub5 = Character.UnicodeBlock.of('A'); // Display UnicodeBlock name System.out.println("ub1 = " + ub1); System.out.println("ub2 = " + ub2); System.out.println("ub3 = " + ub3); System.out.println("ub4 = " + ub4); System.out.println("ub5 = " + ub5); }}

Output

输出量

ub1 = BASIC_LATINub2 = BASIC_LATINub3 = BASIC_LATINub4 = BASIC_LATINub5 = BASIC_LATIN

翻译自:

转载地址:http://zsxzd.baihongyu.com/

你可能感兴趣的文章
【leetcode】Container With Most Water
查看>>
Python -- machine learning, neural network -- PyBrain 机器学习 神经网络
查看>>
一道dp题目
查看>>
mysql中间件研究(tddl atlas cobar sharding-jdbc)
查看>>
Cast-128 加密算法和 MyPassWord 的破解
查看>>
4.28下午 听力611
查看>>
ActiveMQ学习笔记(1)----初识ActiveMQ
查看>>
Java与算法之(2) - 快速排序
查看>>
Windows之IOCP
查看>>
机器学习降维之主成分分析
查看>>
CTP2交易所成交回报
查看>>
WebSocket & websockets
查看>>
《机器学习实战》学习笔记第二章 —— K-近邻算法
查看>>
uni-app 引入本地iconfont的正确姿势以及阿里图标引入
查看>>
DSB
查看>>
Java中的阻塞队列
查看>>
前端软件sublime的一些常用快捷键
查看>>
openssl 升级
查看>>
2017.10.30 天晴 昨天十公里没减肥
查看>>
Git 打标签(分布式版本控制系统)
查看>>