Home Java String-examples String Determining a Character's Unicode Block
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

String Determining a Character's Unicode Block

Advertisement
In this section, you will get the detailed explanation about the UnicodeBlock() method of String class. We are going to use UnicodeBlock() method of String class in Java. The description of the code is given below for the usage of the method.

String Determining a Character's Unicode Block 

     

In this section, you will get the detailed explanation about the UnicodeBlock() method of String class. We are going to use UnicodeBlock() method of String class in Java. The description of the code is given below for the usage of the method.

Description of the code:

As shown in the example we have taken a Unicode of a character. Then we have applied a method UnicodeBlock() to get the character out of the code. Therefore, we get the following output. Similarly, we can take other Unicode as well for different characters and on applying this method we can get that particular character as shown below.

Here is the code of the program: 

public class charUni{
  public static void main(String args[]){
  char ch = '\u1234';
  Character.UnicodeBlock block = Character.UnicodeBlock.of(ch);
  System.out.println(ch);
  }
}

Output of the program:

C:\unique>javac charUni.java

C:\unique>java charUni
?

C:\unique>

Download this example.

Advertisement

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: February 28, 2008

Ask Questions?    Discuss: String Determining a Character's Unicode Block   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
Raman
December 7, 2011
String Determining a Character's Unicode Block

"String Determining a Character's Unicode Block". In this Post in your RoseIndia,If we changed the Uniocode character then still it shows '?'.Could you Please tell me why it shows same.
chris
August 23, 2012
Re: String Determining a Character's Unicode Block

I think you want to print with System.out.println( block );
DMCA.com