Empty string: Difference between revisions

m
→‎{{header|UNIX Shell}}: s='2 -gt 3' is not an empty string.
m (→‎{{header|Ruby}}: Show that s.clear mutates the string.)
m (→‎{{header|UNIX Shell}}: s='2 -gt 3' is not an empty string.)
Line 675:
 
# the "test" command can determine truth by examining the string itself
if [ "$s" ]; then echo "not empty"; else echo "empty"; fi
 
# compare the string to the empty string
Anonymous user