跳轉到內容

Perl 程式設計/關鍵字/chr

來自華夏公益教科書,自由的教科書
前一個:chown 關鍵字 下一個:chroot

Thechr關鍵字

[編輯 | 編輯原始碼]

chr返回用NUMBER指定的字元。負值給出 Unicode 替換字元 (chr(0xfffd),只要沒有選擇 bytes pragma。在這種情況下,會使用截斷為整數的值的低八位。

沒有NUMBER,使用$_的內容。

chrord 的反向操作。

  chr NUMBER
  chr
這些行
#!"C:/Programms/Perl/site/bin"
use 5.10.0;

$number = 65;

say "number = " . $number, " corresponds to the code '" . chr $number . "'";
返回
number = 65 corresponds to the code 'A'
前一個:chown 關鍵字 下一個:chroot
華夏公益教科書