string.gsub
code:Lua
t = textmodule.string.gsub(str, pattern, repl, num)
モジュール
引数
table:_
変数 型 概要
1 str string 元の文字列
2 pattern string 検索文字列(正規表現) 3 repl string 置換する文字列
4 num number 置換する回数(省略可)
返り値
table:_
変数 型 概要
1 t string 処理された文字列
概要
strにある正規表現パターンpatternをreplで置換する。
numで置換の回数を指定できるが、指定しない場合は1になる。