Char
Char is the class for character literals. It can represent any Unicode codepoint.
< Back to core unit
Get a copy of the character.
IO.println('木'.clone()) #> 木
Return a hash for the character value.
def c = '木' IO.println(c.hash) #> 7520348167691861062
Transform the character value into an Int. Return the codepoint value.
Int
def c = '木' IO.println(c.to_i) #> 26408
Transform the character value into a String.
String
def c = '木' IO.println(c.to_s) #> 木
Compares this and other characters based on the codepoint value.
this
other
def c = 'h' IO.println('a' <= c && c <= 'z') #> true IO.println('x' < 'X') #> false IO.println('森' >= '木') #> true