Empty string: Difference between revisions
Content added Content deleted
Line 750: | Line 750: | ||
Note that we can '''not''' do the following, because the empty string is equivalent to true in Ruby ([[Boolean values#Ruby]]): |
Note that we can '''not''' do the following, because the empty string is equivalent to true in Ruby ([[Boolean values#Ruby]]): |
||
<lang ruby>if s then puts "not empty" end</lang> |
<lang ruby>if s then puts "not empty" end</lang> |
||
=={{header|Run BASIC}}== |
|||
<lang runbasic>var$ = "" |
|||
' -------------- |
|||
'empty string |
|||
' ------------- |
|||
if var$="" then print "String is Empty" |
|||
if len(var$)=0 then print "String is Empty" |
|||
' ------------- |
|||
'not empty string |
|||
' ------------- |
|||
if var$<>"" then print "String Not empty." |
|||
if len(var$)>0 then print "String Not empty."</lang> |
|||
=={{header|Scala}}== |
=={{header|Scala}}== |