跳轉到內容

Perl 程式設計/關鍵字/ord

來自華夏公益教科書
上一個:or 關鍵字 下一個:our

theord關鍵字

[編輯 | 編輯原始碼]

ord返回與表示式關聯的數字。如果表示式是空字串,則函式返回 0。如果沒有數字,則使用$_的內容。

ordchr 的反向操作。

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

$character = 'A';

say "character = '" . $character, "' corresponds to the value of " . ord $character;
返回
number = 65 corresponds to the code 'A'
character = 'A' corresponds to the value of 65
上一個:or 關鍵字 下一個:our
華夏公益教科書