darklua
DocumentationTry itGitHub

remove_spaces


Added in 0.7.0

It is important to note that when generating code with the dense or readable generator (e.g. darklua process src --format dense), all the spacing (whitespaces, tabs, new lines) will not be considered. The only way to retain the spacing information is to use the retain_lines format and avoid this rule.

Examples


local function getAverage(array)
    local sum = 0
    for _, element in ipairs(array) do
        sum = sum + element
    end
    return sum / #array
end
InputOutput
local function getAverage(array)
    local sum = 0
    for _, element in ipairs(array) do
        sum = sum + element
    end
    return sum / #array
end
local function getAverage(array)
local sum=0
for _,element in ipairs(array)do
sum=sum+element
end
return sum/#array
end