function count(base, pattern) return select(2, string.gsub(base, pattern, "")) end print(count('Hello World', 'l'))