跳轉到內容

Rebol 程式設計/ascii?

來自華夏公益教科書,自由的教科書
ASCII? value 

如果值或字串在 ASCII 字元範圍內(小於 128),則返回 TRUE。

ASCII? 是一個函式值。

  • value -- (型別:字串 檔案 郵件 URL 標記 問題 字元 整數)

原始碼

[編輯 | 編輯原始碼]
ascii?: func [
    {Returns TRUE if value or string is in ASCII character range (below 128).} 
    value [string! file! email! url! tag! issue! char! integer!] /local 
    ascii
][
    ascii: make bitset! #{
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000
} 
    either any-string? value [parse/all/case value [any ascii]] [value < 128]
]
華夏公益教科書