Jump to content

Empty string: Difference between revisions

added Elixir
(Add Nimrod)
(added Elixir)
Line 369:
if s <> '' then
PrintLn('not empty');</lang>
 
=={{header|Elixir}}==
To check whether a given variable holds an empty string, either compare it to the empty string literal or check its length.
<lang elixir>
empty_string = ""
not_empty_string = "a"
 
empty_string == ""
# => true
String.length(empty_string) == 0
# => true
 
not_empty_string == ""
# => false
String.length(not_empty_string) == 0
# => false
</lang>
 
=={{header|Emacs Lisp}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.