Module:Util/strings/isEmpty

From Zelda Wiki, the Zelda encyclopedia
Jump to navigation Jump to search

isEmpty(str)

Returns

  • true if and only if the value is nil or ""

Examples

#InputOutputResult
1
isEmpty(nil)
true
2
isEmpty("")
true
3
isEmpty(" ")
false

local function isEmpty(str)
	return str == nil or str == ""
end

return isEmpty