We are moved to new domain
Click -> www.ehowtonow.com
Friday, 8 May 2015

How to get Character unicode point in a String

Following example shows how to get unicode point of a character in a String using str.codePointAt(int position) method.

Sample Program

package com.javatutorialcorner.javastring;

public class StringUnicode {

public static void main(String[] args) {
String jtc = "Java tutorials corner contains tutorials for Java programers day to day needs tutorials like Java, Spring, Hibernate, String, JSON, Jackson, GSON, XML parsing, Web Service, SOAP Web Service, RESTful Web Service";
int position = 6;
System.out.println("String input : " + jtc);
System.out.println("Unicode point at position " + position
+ " in the String " + jtc.codePointAt(position));

}

}


Result


The above code will produce the following output.



String input : Java tutorials corner contains tutorials for Java programers day to day needs tutorials like Java, Spring, Hibernate, String, JSON, Jackson, GSON, XML parsing, Web Service, SOAP Web Service, RESTful Web Service
Unicode point at position 6 in the String 117

Shop and help us

Flipkart Offer Snapdeal offer Amazon.in offer Amazon.com offer
  • Blogger Comments
  • Facebook Comments
  • Disqus Comments

0 comments:

Post a Comment

Item Reviewed: How to get Character unicode point in a String Rating: 5 Reviewed By: eHowToNow