local Option1 = false --true to remove line breaks
local Option2 = false --true to remove all spaces
local Option3 = false --true to remove spaces in the end of each line
local Text = [[
--Put your text here
]]
--Script
if Option1 and not Option2 and Option3 or Option1 and not Option2 and not Option3 then
local String = Text:gsub("[\r\n%z]", " ")--Removes line breaks
print(String)
end
if not Option1 and Option2 and Option3 or not Option1 and Option2 and not Option3 then
local String = Text:gsub("[ \t]", "")--Removes all spaces
print(String)
end
if Option1 and Option2 and Option3 or Option1 and Option2 and not Option3 then
local String = Text:gsub("[ \n]", "")--Removes line breaks/all spaces
print(String)
end
if not Option1 and not Option2 and Option3 then
local String = Text:gsub("[ \t]+%f[\r\n%z]", "")--Removes spaces in the end of each line
print(String)
end
--Error
if not Option1 and not Option2 and not Option3 then
print("Error: Please enable an option at line 1/2/3")
end