KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
What is the "correct" way of comparing a code-point to a Java character? For example: int codepoint = String.codePointAt(0); char token = '\n'; I know I can probably do: if (codepoint==(int) token) { ... } but this code looks fragile. Is there a formal API method for comparing codepoints to chars , or converting the char up to a codepoint for comparison?
Tags (comma-separated)
Save Edits
Cancel