Mô đun:string/php trim

Từ điển mở Wiktionary
local find = string.find
local match = string.match

-- Note: PHP does not trim \f but does trim \0.
return function(text)
	local n = find(text, "[^%z\t-\v\r ]")
	return n and match(text, ".*[^%z\t-\v\r ]", n) or ""
end