Jump to content

Character codes: Difference between revisions

(Added LFE example)
Line 880:
 
=={{header|Scala}}==
[[Category:Scala Implementations]]
{{libheader|Scala}}
Scala supports unicode characters, but each character is UTF-16, so
there is not a 1-to-1 relationship for supplementary character sets.
Line 885 ⟶ 887:
Without worrying about supplemental character sets:
<lang scala>scala> 'a' toInt
res9res2: Int = 97
 
scala> 97 toChar
res10res3: Char = a</lang>
 
scala> '\u0061'
res4: Char = a</lang>
 
Worrying about supplemental character sets, we need to test the "next" character as well:
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.