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.

StringUnicode

package com.ehowtonow.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));

    }

}

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


Ask your questions in eHowToNow Forum

Post your technical, non-technical doubts, questions in our site. Get answer as soon as possible, meanwhile you can help others by answering, unanswered questions.
To Ask new Question : Ask Question
Check our existing discussions : Questions & Answers

  1. How to get Character unicode point in a String
  2. Java String indexOf(int ch, int fromIndex) method with example
  3. Java String codePointAt() method with example
  4. Java String codePointBefore() method with example
  5. How to format the String by using Locale
  6. Java String endsWith() method with example
  7. Java String codePointCount() method with example
  8. Java String charAt() method with example
  9. Java String format(String format, Object… args) method with example
  10. How to convert a String to Lower case
  11. String Concatenation in Java
  12. How to find last occurrence of substring inside string
  13. How to search a word inside String
  14. How to Split the String in Java
  15. Java String indexOf(int ch) method with example

Be the first to comment

Leave a Reply