RosettaCodeData/Task/Empty-string/Erlang/empty-string.erl
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

8 lines
242 B
Erlang

1> S = "". % erlang strings are actually lists, so the empty string is the same as the empty list [].
[]
2> length(S).
0
3> case S of [] -> empty; [H|T] -> not_empty end.
empty
4> case "aoeu" of [] -> empty; [H|T] -> not_empty end.
not_empty