RosettaCodeData/Task/Empty-string/Erlang/empty-string.erl

9 lines
242 B
Erlang
Raw Permalink Normal View History

2013-04-10 16:57:12 -07:00
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