RosettaCodeData/Task/Empty-string/EMal/empty-string.emal

10 lines
359 B
Text
Raw Permalink Normal View History

2023-12-16 21:33:55 -08:00
# Demonstrate how to assign an empty string to a variable.
2025-02-27 18:35:13 -05:00
text sampleA ← Text.EMPTY
text sampleB ← "hello world"
text sampleC ← ""
List samples ← text[sampleA, sampleB, sampleC]
2023-12-16 21:33:55 -08:00
for each text sample in samples
# Demonstrate how to check that a string is empty.
2025-02-27 18:35:13 -05:00
writeLine("Is '", sample, "' empty? ", when(sample.isEmpty(), "Yes", "No"), ".")
2023-12-16 21:33:55 -08:00
end