官术网_书友最值得收藏!

  • Perl 6 Deep Dive
  • Andrew Shitov
  • 81字
  • 2021-07-03 00:05:50

Converting to a character using the chr method

Integer values can be converted to the corresponding character. The correspondence is defined by the Unicode codepoint. 

In the case of values below 256, it coincides with the ASCII table. Considering the following code snippet:

say 65.chr; # prints A

Higher values produce characters from the Unicode tables, as shown here:

say 8594.chr; # →

The same result can be obtained using the hexadecimal representation, as shown here:

say 0x2192.chr; # →
主站蜘蛛池模板: 翁源县| 池州市| 波密县| 张家川| 抚州市| 贡觉县| 葫芦岛市| 沙洋县| 葵青区| 依兰县| 内乡县| 夏邑县| 东源县| 万山特区| 遵化市| 双江| 云林县| 正宁县| 正宁县| 交城县| 炉霍县| 南部县| 乡城县| 宁明县| 盖州市| 牡丹江市| 台南县| 确山县| 社旗县| 河北省| 吴川市| 磐石市| 修武县| 疏附县| 中方县| 万年县| 库车县| 铜陵市| 广南县| 山西省| 大埔县|