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

  • 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; # →
主站蜘蛛池模板: 怀宁县| 龙泉市| 神木县| 元朗区| 商丘市| 锦屏县| 阜宁县| 建昌县| 英超| 志丹县| 丰顺县| 道孚县| 桦川县| 浙江省| 密云县| 肥城市| 承德县| 淳安县| 永昌县| 潮安县| 阿克苏市| 乳山市| 会宁县| 井陉县| 海安县| 如东县| 汪清县| 日照市| 柯坪县| 刚察县| 锦州市| 都昌县| 临清市| 利川市| 浪卡子县| 咸丰县| 中牟县| 四平市| 保定市| 苍溪县| 准格尔旗|