RosettaCodeData/Task/Empty-string/QBasic/empty-string.basic

17 lines
411 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
SUB IsEmpty (s AS STRING)
IF LEN(s) = 0 THEN
2026-02-01 16:33:20 -08:00
PRINT "String is empty"
2023-07-01 11:58:00 -04:00
ELSE
2026-02-01 16:33:20 -08:00
PRINT "String is not empty"
2023-07-01 11:58:00 -04:00
END IF
2026-02-01 16:33:20 -08:00
IF s = "" THEN PRINT "yes, the string is empty"
2023-07-01 11:58:00 -04:00
IF s <> "" THEN PRINT "no, the string is not empty"
END SUB
DIM s AS STRING ' implicitly assigned an empty string
IsEmpty (s)
t$ = "" ' explicitly assigned an empty string
IsEmpty (t$)
u$ = "not empty"
IsEmpty (u$)