Anonymous user
Empty string: Difference between revisions
per previous discussion, removing claim about syntax for empty strings; update examples; copyedit
(added assigning an empty string) |
(per previous discussion, removing claim about syntax for empty strings; update examples; copyedit) |
||
Line 1:
{{draft task}}
The task is to:
* Demonstrate how to assign an empty string to a variable.
* Demonstrate how to check that a string is empty.
* Demonstrate how to check that a string is not empty.
Line 58:
=={{header|Icon}} and {{header|Unicon}}==
Icon and Unicon
<lang Icon>s := "" # null string
s := string('A'--'A') # ... converted from cset difference
Line 156:
=={{header|PicoLisp}}==
The empty string is represented by '[http://software-lab.de/doc/ref.html#nilSym NIL]' in PicoLisp. During input, two subsequent double
<lang PicoLisp># To assign a variable an empty string:
(off String)
Line 196:
=={{header|Python}}==
The empty string is printed by Python REPL as <nowiki>''</nowiki>, and is treated as boolean false
<lang python>s = ''
if not s:
|