A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.tutorialspoint.com/javaexamples/string_codepointbefore.htm below:

How to determine the Unicode code point in string using Java

How to determine the Unicode code point in string using Java 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

java_strings.htm


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4