RosettaCodeData/Task/Empty-string/Nim/empty-string.nim

13 lines
151 B
Nim

var x = ""
if x == "":
echo "empty"
if x != "":
echo "not empty"
# Alternatively:
if x.len == 0:
echo "empty"
if x.len > 0:
echo "not empty"