local str_v = string.rep("7", 3)
-- str_v = 777
-- 任何字符串都能重复,不限于单个字符
local laugh = string.rep("ha", 3)
-- laugh = hahaha
-- 次数为零或负数时得到空字符串,不报错
local empty = string.rep("7", -1)
-- empty = ''
-- 第 3 个参数放在各个副本之间
local dashed = string.rep("ab", 3, "-")
-- dashed = ab-ab-ab
print("str_v = " .. str_v)
print("laugh = " .. laugh)
print("empty = '" .. empty .. "'")
print("dashed = " .. dashed)