Empty string: Difference between revisions
Content added Content deleted
(→{{header|Lasso}}: adding examples for Lasso detecting empty strings) |
No edit summary |
||
Line 980: | Line 980: | ||
if {[string length $s] == 0} {puts "is empty"} |
if {[string length $s] == 0} {puts "is empty"} |
||
if {[string compare $s ""] != 0} {puts "is non-empty"}</lang> |
if {[string compare $s ""] != 0} {puts "is non-empty"}</lang> |
||
⚫ | |||
⚫ | |||
$empty = ""; |
|||
⚫ | |||
if($empty $= "") { echo("$empty is an empty string."); } |
|||
Check if $empty is not an empty string |
|||
if($empty !$= "") { echo("$empty is not an empty string."); } |
|||
=={{header|TUSCRIPT}}== |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
IF (s!="") PRINT "s is a non-empty string" |
|||
⚫ | |||
⚫ | |||
⚫ | |||
s is an empty string |
|||
⚫ | |||
=={{header|TXR}}== |
=={{header|TXR}}== |
||
Line 998: | Line 1,018: | ||
(if (zerop (length *a*)) |
(if (zerop (length *a*)) |
||
(format t "guess what?\n")))</lang> |
(format t "guess what?\n")))</lang> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|UNIX Shell}}== |
=={{header|UNIX Shell}}== |