How to get the unicode of a character at specific index in StringBuffer with Java

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
        StringBuffer sb = new StringBuffer("PHP Java C++ C# C Python"); 

        System.out.println(sb.codePointAt(4)); 
        System.out.println(sb.codePointAt(5)); 
        System.out.println(sb.codePointAt(6)); 
    }
}



/*
run:

74
97
118

*/

 



answered Apr 23, 2020 by avibootz
...