How to determines if the given char value is a Unicode high-surrogate code unit in Java

1 Answer

0 votes
package javaapplication1;
 
public class JavaApplication1 {
   
    public static void main(String[] args) {
          
        char ch = '\u0c5e';
        boolean b;

        b = Character.isHighSurrogate(ch);
        System.out.println(b);
        
        b = Character.isHighSurrogate('\ud9ff');
        System.out.println(b);
    }
}
 
/*
run:

false
true
 
*/

 



answered Sep 13, 2016 by avibootz
edited Sep 13, 2016 by avibootz
...