string.byte
code:Lua
b1, b2, ... = textmodule.string.byte(str, i, j)
モジュール
引数
table:_
変数 型 概要
1 str string 文字列
2 i number 取得開始位置
3 j number 取得する長さ
返り値
table:_
変数 型 概要
1 b1 number 1文字目の文字コード
2 b2 number 2文字目の文字コード
...
n bn number n文字目の文字コード
概要
strのi文字目からj文字目の文字コードを返す。
iを省略した場合は、1になる。
jを省略した場合は、iと同じ値になる。
例
code:Lua
require("textmodule")
b1, b2, b3, b4 = textmodule.string.byte("よろしく")
debug_print(b1) -- 0x3088
debug_print(b2) -- 0x308d
debug_print(b3) -- 0x3057
debug_print(b4) -- 0x304f