Is there any possibility to convert sign>>" to sign>>_
If yes then how.
Write a custom dofile function that reads the file, replaces all _ with " and then compiles and executes it.
Quote from: EK.IceFlake on Feb 14, 2017, 10:47 AMWrite a custom dofile function that reads the file, replaces all _ with " and then compiles and executes it.
No i mean if player types /cmd text
suppose text contain this sign "
so is there any possibility to convert it to _ .
Quote from: zeus on Feb 14, 2017, 10:50 AMQuote from: EK.IceFlake on Feb 14, 2017, 10:47 AMWrite a custom dofile function that reads the file, replaces all _ with " and then compiles and executes it.
No i mean if player types /cmd text
suppose text contain this sign "
so is there any possibility to convert it to _ .
I'm not sure if string.replace is a function, but if it is
command.replace("\"", "_");
function SearchAndReplace(str, search, replace) {
local li = 0, ci = str.find(search, li), res = "";
while (ci != null) {
if (ci > 0) {
res += str.slice(li, ci);
res += replace;
} else res += replace;
li = ci + search.len(), ci = str.find(search, li);
}
if (str.len() > 0) res += str.slice(li);
return res;
}
local r = SearchAndReplace("and he said \"what?\" before leaving", "\"", "_");
print(r);