routine ord
1 | class Str |
1.1 | (Str) routine ord |
2 | class Cool |
2.1 | (Cool) routine ord |
Documentation for routine ord
assembled from the following types:
class Str
From Str
(Str) routine ord
multi sub ord(Str --> Int)multi method ord(Str: --> Int)
Returns the codepoint number of the base characters of the first grapheme in the string.
Example:
ord("A"); # 65"«".ord; # 171
class Cool
From Cool
(Cool) routine ord
Defined as:
sub ord(Str(Cool))method ord()
Coerces the invocant (or in sub form, its argument) to Str, and returns the Unicode code point number of the first code point.
say 'a'.ord; # OUTPUT: «97»
The inverse operation is chr.
Mnemonic: returns an ordinal number