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

  • 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; # →
主站蜘蛛池模板: 永新县| 广昌县| 武川县| 策勒县| 米林县| 留坝县| 肇庆市| 交城县| 东兴市| 郑州市| 淮安市| 绥江县| 福建省| 洛隆县| 新昌县| 惠水县| 阳泉市| 锦屏县| 海安县| 内乡县| 利辛县| 周口市| 裕民县| 常州市| 株洲县| 盐源县| 伊宁市| 涿鹿县| 潍坊市| 兴宁市| 邮箱| 怀远县| 丰顺县| 谷城县| 安福县| 崇礼县| 防城港市| 彰化市| 广南县| 福建省| 巍山|