RosettaCodeData/Task/Empty-string/NetRexx/empty-string.netrexx

22 lines
659 B
Plaintext

/* NetRexx */
options replace format comments java crossref symbols binary
s1 = '' -- assignment
s2 = "" -- equivalent to s1
parse '.' . s3 . -- parsing a token that doesn't exist results in an empty string
strings = [s1, s2, s3, ' ']
loop s_ = 0 to strings.length - 1
say (Rexx s_).right(3)':\-'
select
when strings[s_] == '' then say ' "'strings[s_]'" is really empty'
when strings[s_].length = 0 then say ' "'strings[s_]'" is empty'
when strings[s_] = '' then say ' "'strings[s_]'" looks empty but may not be'
when strings[s_].length > 0 then say ' "'strings[s_]'" is not empty'
otherwise nop
end
end s_
return