Documentation for routine ords
Documentation for routine ords, assembled from the following types:
sub ords(Str(Cool) )method ords()
Coerces the invocant (or in the sub form, the first argument) to Str, and returns a list of Unicode codepoints for each character.
say "Camelia".ords; # OUTPUT: «67 97 109 101 108 105 97␤»say ords 10; # OUTPUT: «49 48␤»
multi method ords(Str: --> Positional)
Returns a list of Unicode codepoint numbers that describe the codepoints making up the string.
"aå«".ords; # (97 229 171)
Strings are represented as graphemes. If a character in the string is represented by multiple codepoints, then all of those codepoints will appear in the result of
ords. Therefore, the number of elements in the result may not always be equal to chars, but will be equal to codes.