Java Character isHighSurrogate() MethodThe isHighSurrogate(char ch) method of Character class determines whether the given value is high-surrogate code unit, which is also called a leading surrogate code unit. These values cannot be used to represent the characters by themselves, but they can be used in the representation of supplementary characters in the UTF-16 encoding. SyntaxParameterThe above method requires only one parameter: a.)The character value that needs to be tested. Return ValueThe isHighSurrogate(char ch) method returns a boolean value, i.e., true if the value of the character lies in between MIN_HIGH_SURROGATE and MAX_HIGH_SURROGATE. Otherwise, this method returns false. Example 1Output: The first character is a Unicode high-surrogate code unit: true The second character is a Unicode high-surrogate code unit: false The third character is a Unicode high-surrogate code unit: false Example 2Output: The character 'Z' is a Unicode high-surrogate code unit: false The character 'z' is a Unicode high-surrogate code unit: false |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India