Anonymous user
Empty string: Difference between revisions
no edit summary
(→{{header|Lasso}}: adding examples for Lasso detecting empty strings) |
No edit summary |
||
Line 980:
if {[string length $s] == 0} {puts "is empty"}
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}}==
<lang tuscript>▼
$$ MODE TUSCRIPT▼
s=""▼
IF (s!="") PRINT "s is a non-empty string"
</lang>▼
Output:▼
<pre>▼
s is an empty string
</pre>▼
=={{header|TXR}}==
Line 998 ⟶ 1,018:
(if (zerop (length *a*))
(format t "guess what?\n")))</lang>
▲=={{header|TUSCRIPT}}==
▲<lang tuscript>
▲$$ MODE TUSCRIPT
▲s=""
▲IF (s=="") PRINT "s is an empty string"
▲IF (s!="") PRINT "s is a non-empty string"
▲</lang>
▲Output:
▲<pre>
▲s is an empty string
▲</pre>
=={{header|UNIX Shell}}==
|