Skip to content

Commit

Permalink
doc: update docs/lua.md (#661)
Browse files Browse the repository at this point in the history
* Update lua.md

* Update lua.md

* Update lua.md
  • Loading branch information
leauny authored Jun 8, 2024
1 parent 7494981 commit df9c2ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/lua.md
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,8 @@ string.lower("STR") -- str

-- 指定替换的字符串个数, 最后一个参数可选,默认是全部替换
string.gsub("aaaa", "a", "b", 3) -- bbba 3
string.gsub("Today is 29/01/2019", "%d%d/%d%d/%d%d%d%d", "good day.")
-- Today is a good day. 1
string.gsub("Today is 29/01/2019", "%d%d/%d%d/%d%d%d%d", "a good day.")
-- Today is a good day.

-- 查找第一个匹配的字符串,第三个参数可以提供开始查找的位置,默认从 1 开始
-- 如果未找到,则返回 nil
Expand Down

0 comments on commit df9c2ac

Please sign in to comment.