Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR LUA

lua string count occurrence

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

print(count('Hello World', 'l'))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #lua #string #count #occurrence
ADD COMMENT
Topic
Name
9+8 =