publicclassStringUniCode{publicstaticvoidmain(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));}}
结果
上面的代码示例将产生以下结果。
String under test is =WelcometoTutorialsPointUnicode code point at position 5 in the string is =111