How to determine if a char value is a Unicode low-surrogate code unit trailing-surrogate code unit) in Java

1 Answer

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

        boolean b;
        
        b = Character.isLowSurrogate(ch);
        System.out.println(b);
        
        System.out.println(Character.isLowSurrogate('\udc31'));
        
        System.out.println(Character.isLowSurrogate('\n'));
    }
}
 
/*
run:

false
true
false
 
*/

 



answered Sep 15, 2016 by avibootz
...