Answers for "lua string count occurrence"

Lua
0

lua string count occurrence

function count(base, pattern)
    return select(2, string.gsub(base, pattern, ""))
end

print(count('Hello World', 'l'))
Posted by: Guest on September-21-2021

Code answers related to "lua string count occurrence"

Browse Popular Code Answers by Language