Lua: How do I place something between two or more repeating characters in a string?
snippet in lua

Lua: How do I place something between two or more repeating characters in a string?

user4766

function test(s)
    local t=s:gsub("%?%?","?-?"):gsub("%?%?","?-?")
    print(#s,s,t)
end

for n=0,10 do
    test(string.rep("?",n))
end