Tutorials Point


  Java Basics Examples
  Java Tutorial
  Java Useful Resources
  Selected Reading

© 2011 TutorialsPoint.COM


  Home     References     Discussion Forums     About TP  

Java Examples - String uni code


previous next AddThis Social Bookmark Button


Problem Description:

How to determine the Unicode code point in string ?

Solution:

This example shows you how to use codePointBefore() method to return the character (Unicode code point) before the specified index.

public class StringUniCode{
   public static void main(String[] args){
      String test_string="Welcome to TutorialsPoint";
      System.out.println("String under test is = "+test_string);
      System.out.println("Unicode code point at" 
      +" position 5 in the string is = "
      +  test_string.codePointBefore(5));
   }
}

Result:

The above code sample will produce the following result.

String under test is = Welcome to TutorialsPoint
Unicode code point at position 5 in the string is =111


previous next Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names