liquid_feedback_frontend

view env/util/trim.lua @ 236:de8602f8d9bb

Make trim properly handle nil as an argument
author Ingo Bormuth <mail@ibormuth.de>
date Sun Nov 27 13:33:42 2011 +0100 (2011-11-27)
parents 0ee1e0c42d4c
children
line source
1 function util.trim(string)
2 if string == nil then
3 return string
4 end
5 return (string:gsub("^%s*", ""):gsub("%s*$", ""):gsub("%s+", " "))
6 end

Impressum / About Us