String Find
String Find
String.Calc = function(a , b)
return a + b, a - b , a * b , a / b
end
while start do
print("\n\nFound 'fox' at indices:", start, finish.."\n\n")
start, finish = string.find(story, pattern, finish)
counter = counter + 1
if start == nil then
local start, finish = string.find(story, pattern)
print("\n\nUsing sting.sub() to print the word : "
.."\""..string.sub(story, start, finish)
.."\"\n\nNumber of repetations : "..counter)
end
end
print(extractDomain("https://www.outlook.com"))
print(extractDomain("http://sub.example.who.org/pages"))
print(extractDomain("http:///sub.example.who.org/pages"))
while startPos do
startPos, endPos = text:find(pattern, endPos)
if startPos then
local email = text:sub(startPos, endPos)
print("Found email:", email)
endPos = endPos + 1
end
end