Basic implement to strip trailing whitespace from a string in lua.
Accepts a string, returns a string, simple
function rtrim(s) return s:match'^(.*%S)%s*$' end
local a = ' abcde ' print( a..'END' ) print(rtrim(a)..'END')