Empty string: Difference between revisions

No change in size ,  12 years ago
m
I don't know Tcl but I guess this is a typo
(Added PicoLisp)
m (I don't know Tcl but I guess this is a typo)
Line 172:
<lang tcl>set s ""
if {$s eq ""} {puts "s contains an empty string"}
if {$s ne ""} {phtsputs "s contains a non-empty string"}</lang>
There are other ways to check for emptiness and non-emptiness too (though the above are favored for reasons of simplicity, clarity and speed):
<lang tcl>if {[string equal $s ""]} {puts "is empty"}