lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi All, 

I am very new to LUA. Going through the manuals and tutorials these days.

I was trying to write a function for filtering out charachters like
, . " \  from the string. I wrote a small function for this but somehow it is not working in the correct manner. Please take a look and it would be great if you can please suggest changes to correct it.

function WeiredChars(s)
local x=1
if string.find(s,".")~='nil' then
  x=0
end
if string.find(s,",")~='nil' then
  x=0
end
if string.find(s,"\\")~='nil' then
  x=0
end
if string.find(s,[["]])~='nil' then
  x=0
end
if x==0 then
  return "weired chars"
end
return nil
end


Thanks,
Nilay Tripathi