All pastes #2054772 Raw Edit

Mine

public text v1 · immutable
#2054772 ·published 2011-05-07 05:29 UTC
rendered paste body
-- Warning, will stack overflow on recursive tables
function wesutil.dumpTable(t, indent, indentString)
	local str = ""
	if indent == nil then indent="" end
	if indentString == nil then indentString = "  " end

	for k,v in pairs(t) do
		local start = indent .. tostring(k) .. " = "
		if type(v) == "table" then
			str = str .. start .. "{\n" .. wesutil.dumpTable(v, indent .. indentString, indentString) .. indent .. "}\n"
		elseif type(v) == "number" then
			str = str .. start .. tostring(v)
		else
			str = str .. start .. "\"" .. tostring(v) .. "\"\n"
		end
	end
	return str
end