- 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; # →
推薦閱讀
- Visual Basic .NET程序設計(第3版)
- 程序員面試白皮書
- DevOps with Kubernetes
- C語言程序設計(第3版)
- Python從小白到大牛
- Learning RxJava
- R語言編程指南
- Building a Recommendation Engine with Scala
- HTML5+CSS3網站設計教程
- Internet of Things with ESP8266
- Clojure for Machine Learning
- C編程技巧:117個問題解決方案示例
- Android Development Tools for Eclipse
- Extending Docker
- SQL Server 2014數據庫設計與開發教程(微課版)