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>

=={{header|TorqueScript}}==
Assign an empty string to $empty
$empty = "";
Check if $empty is an empty string
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 an empty string"
IF (s!="") PRINT "s is a non-empty string"
</lang>
Output:
<pre>
s is an empty string
</pre>


=={{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|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}}==
=={{header|UNIX Shell}}==