Character.isLowSurrogate() in Java

Character.isLowSurrogate(): This method is available in java.lang.Character class of Java.

Syntax:

boolean java.lang.Character.isLowSurrogate(char ch)

This method takes one argument of type char as its parameter. This method determines if the given char value is a Unicode low-surrogate code unit(also known as a trailing-surrogate code unit).

Note: Such values do not represent characters by themselves but are used in the representation of supplementary characters in the UTF-16 encoding.

Parameters: One parameter is required for this method.

ch: the char value to be tested.

Returns: true if the char value is between MIN_LOW_SURROGATE and MAX_LOW_SURROGATE inclusive; false otherwise.

Exceptions: NA

Approach

Java

public class CharacterisLowSurrogate {
    public static void main(String[] args) {

        char ch = 'a';
        System.out.println(Character.isLowSurrogate(ch));
    }
}

Output:

false

No comments:

Post a Comment