Empty string: Difference between revisions

Content added Content deleted
(≢ is shape, not rank)
(add gwbasic)
Line 1,277: Line 1,277:
s = '1 is the loneliest number'
s = '1 is the loneliest number'
assert !s.empty</lang>
assert !s.empty</lang>

=={{header|GW-BASIC}}==
<lang gwbasic>10 DIM S1$ 'implicitly defined empty string
20 S2$ = "" 'explicitly defined empty string
30 S3$ = "Foo bar baz"
40 S$=S1$ : GOSUB 200
50 S$=S2$ : GOSUB 200
60 S$=S3$ : GOSUB 200
70 END
200 IF LEN(S$)=0 THEN PRINT "Empty string" ELSE PRINT "Non-empty string"
210 RETURN</lang>


=={{header|Harbour}}==
=={{header|Harbour}}==
Line 1,287: Line 1,298:
? cString
? cString
ENDIF</lang>
ENDIF</lang>




=={{header|Haskell}}==
=={{header|Haskell}}==