- 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 C++第3版
- LaTeX Cookbook
- 在最好的年紀學Python:小學生趣味編程
- JavaScript高效圖形編程
- 華為HMS生態與應用開發實戰
- UML+OOPC嵌入式C語言開發精講
- Unity Shader入門精要
- SharePoint Development with the SharePoint Framework
- Java編程的邏輯
- Test-Driven Development with Django
- PHP 7從零基礎到項目實戰
- Scratch·愛編程的藝術家
- SwiftUI極簡開發
- ASP.NET 4.0 Web程序設計
- Get Your Hands Dirty on Clean Architecture