Empty string: Difference between revisions

no edit summary
m (Update Lang example: Fix spelling of Lang)
No edit summary
Line 1,281:
 
Also possible is <code>(string= "" str)</code>.
 
=={{header|EMal}}==
<syntaxhighlight lang="emal">
# Demonstrate how to assign an empty string to a variable.
text sampleA = Text.EMPTY
text sampleB = "hello world"
text sampleC = ""
List samples = text[sampleA, sampleB, sampleC]
for each text sample in samples
# Demonstrate how to check that a string is empty.
writeLine("Is '" + sample + "' empty? " + when(sample.isEmpty(), "Yes", "No") + ".")
end
</syntaxhighlight>
{{out}}
<pre>
Is '' empty? Yes.
Is 'hello world' empty? No.
Is '' empty? Yes.
</pre>
 
=={{header|Erlang}}==
224

edits