Home » Tip Bank » Java
  • Comment on this Article
Language: Java
Expertise: Intermediate
Mar 31, 2020

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Watch

Check if a Code Point Is a Surrogate Pair

We can check if a given code point is a surrogate pair as below (128149 is the given code point):

if (Character.toChars(128149).length) == 2) {...} // 2 indicates a surrogate pair 
Octavia Anghel
 
Submit a Tip
Browse "Java" Tips
Browse All Tips
htmlgoodies.com
javascriptkit.com