Jump to content

Empty string: Difference between revisions

Added PicoLisp
(→‎{{header|Perl 6}}: Added PureBasic)
(Added PicoLisp)
Line 119:
say 'String is empty' unless $s.chars;
say 'String is not empty' if $s.chars;</lang>
 
=={{header|PicoLisp}}==
The empty string is represented by '[http://software-lab.de/doc/ref.html#nilSym NIL]' in PicoLisp. During input, two subsequent double qoutes '""' return the symbol NIL.
<lang PicoLisp># To assign a variable an empty string:
(off String)
(setq String "")
(setq String NIL)
 
# To check for an empty string:
(or String ..)
(ifn String ..)
(unless String ..)
 
# or a non-empty string:
(and String ..)
(if String ..)
(when String ..)</lang>
 
=={{header|PureBasic}}==
In PureBasic we can just test a string for truth to determine if it has a value.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.