VOOZH about

URL: https://www.geeksforgeeks.org/java/character-islowsurrogate-method-in-java-with-examples/

⇱ Character.isLowSurrogate() method in Java with examples - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Character.isLowSurrogate() method in Java with examples

Last Updated : 6 Dec, 2018
The java.lang.Character.isLowSurrogate(char ch) is an inbuilt method in java which determines if the given char value is a Unicode low-surrogate code unit (also known as trailing-surrogate code unit). Such values do not represent characters by themselves but are used in the representation of supplementary characters in the UTF-16 encoding. Syntax:
public static boolean isLowSurrogate(char ch)
Parameters: The function accepts one mandatory parameter ch which specifies the character to be tested. Return Value: The function returns a boolean value. The value returned is True if the char value is between MIN_LOW_SURROGATE and MAX_LOW_SURROGATE inclusive, False otherwise. Below programs illustrate the Character.isLowSurrogate() method: Program 1:
Output:
c1 is a Unicode low-surrogate ? true
h is a Unicode low-surrogate ? false
Program 2:
Output:
c1 is a Unicode low-surrogate ? true
x is a Unicode low-surrogate ? false
Reference: https://docs.oracle.com/javase/7/docs/api/java/lang/Character.html#isLowSurrogate(char)
Comment