Skip to main content
correção do código (comentários com // em vez de --) e correção ortográfica
Fonte Link

Possivelmente assim:

//--remover todos os /n
local result = string.gsub(s, "n", " ") -- remove line breaks

//--Depois procurasprocurar aas palavrapalavras
str = "This is some text containing the word tiger."
if string.match(str, "tiger") then
  print ("The word tiger was found.")
else
  print ("The word tiger was not found.")
end

Possivelmente assim:

//remover todos os /n
local result = string.gsub(s, "n", " ") -- remove line breaks

//Depois procuras a palavra
str = "This is some text containing the word tiger."
if string.match(str, "tiger") then
  print ("The word tiger was found.")
else
  print ("The word tiger was not found.")
end

Possivelmente assim:

--remover todos os /n
local result = string.gsub(s, "n", " ") -- remove line breaks

--Depois procurar as palavras
str = "This is some text containing the word tiger."
if string.match(str, "tiger") then
  print ("The word tiger was found.")
else
  print ("The word tiger was not found.")
end
Fonte Link
jsantos1991
  • 2,4mil
  • 4
  • 21
  • 42

Possivelmente assim:

//remover todos os /n
local result = string.gsub(s, "n", " ") -- remove line breaks

//Depois procuras a palavra
str = "This is some text containing the word tiger."
if string.match(str, "tiger") then
  print ("The word tiger was found.")
else
  print ("The word tiger was not found.")
end