- 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; # →
推薦閱讀
- C#高級編程(第10版) C# 6 & .NET Core 1.0 (.NET開發(fā)經(jīng)典名著)
- Cocos2D-X權(quán)威指南(第2版)
- Kubernetes實戰(zhàn)
- Vue.js入門與商城開發(fā)實戰(zhàn)
- C語言程序設計基礎(chǔ)與實驗指導
- 基于差分進化的優(yōu)化方法及應用
- Learning Zurb Foundation
- 組態(tài)軟件技術(shù)與應用
- Swift語言實戰(zhàn)精講
- Microsoft Azure Storage Essentials
- 圖數(shù)據(jù)庫實戰(zhàn)
- Practical Microservices
- Android Studio Cookbook
- Web前端開發(fā)技術(shù)實踐指導教程
- Python 3.6從入門到精通(視頻教學版)