Smeers
|
  |
| Joined: 14 Feb 2013 |
| Total Posts: 797 |
|
|
| 13 Mar 2016 12:51 PM |
This is very sloppy
function filterText(text) local example1, x = text, nil
example1, x = example1:gsub("text3", " ") local example2,z = example1, nil example2, z = example2:gsub([[text2]],[[']]) local example,a = example2, nil example, a = example:gsub([[text1]],[["]]) return example end
plsfix?
is there a better way to do this? |
|
|
| Report Abuse |
|
Smeers
|
  |
| Joined: 14 Feb 2013 |
| Total Posts: 797 |
|
| |
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 13 Mar 2016 01:47 PM |
local FilteredWords = { ["text3"] = " ", ["text2"] = "'", ["text1"] = "\"", }
local function Filter(Text) for Word,Replacement in next, FilteredWords do Text = Text:gsub(Word,Replacement) end return Text end
|
|
|
| Report Abuse |
|