- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java Program to determine a Character's Unicode Block
To determine a Character’s Unicode Block, use the Character.UnicodeBlock.of() method in Java. The method returns the object representing the Unicode block containing the given character, or null if the character is not a member of a defined block.
Let us see the syntax of Character.UnicodeBlock.of() method.
Character.UnicodeBlock of(char c)
Here, c is the character.
The following is an example that shows how we can represent the Unicode block containing the given character.
Example
public class Demo { public static void main(String []args) { char ch = '\u5639'; System.out.println(ch); Character.UnicodeBlock block = Character.UnicodeBlock.of(ch); System.out.println(block); System.out.println(Character.UnicodeBlock.of(' ')); System.out.println(Character.UnicodeBlock.of('\u21ac')); System.out.println(Character.UnicodeBlock.of(1565)); } }
Output
嘹 CJK_UNIFIED_IDEOGRAPHS BASIC_LATIN ARROWS ARABIC
Advertisements