The Wayback Machine - https://web.archive.org/web/20160322032619/http://doc.perl6.org/routine/chr

Documentation for routine chr

Documentation for routine chr, assembled from the following types:

class Cool

From Cool

routine chr

Defined as:

sub chr(Int(Cool))
method chr()

Usage:

chr INTEGER
INTEGER.chr

Coerces the invocant (or in sub form, its argument) to Int, interprets it as a Unicode code points, and returns a string made of that code point.

say '65'.chr;       # A

The inverse operation is ord.

Mnemonic: turns an integer into a character.

class Int

From Int

routine chr

Defined as:

multi sub    chr(Int:D ) returns Str:D
multi method chr(Int:D:) returns Str:D

Usage:

chr INTEGER
INTEGER.chr

Returns a one-character string, by interpreting the integer as a Unicode codepoint number and converting it the corresponding character.

Example:

65.chr  # returns "A"
196.chr # returns "Ä"
Morty Proxy This is a proxified and sanitized view of the page, visit original site.