RosettaCodeData/Task/Empty-string/Nim/empty-string.nim
2016-12-05 23:44:36 +01:00

12 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"