[erlang-questions] How can I determine if a list is a just a string or a list of strings?

Ulf Wiger ulf.wiger@REDACTED
Thu Sep 10 18:10:44 CEST 2009

Magnus Falk wrote:
> Hi all,
> I have a variable that can either contain a list of strings or a just a
> string. Is there a good way to tell what kind I'm, dealing with?
> "" vs. ["", ""]

The classic 'dirty trick' test is is_integer(hd(String)).

Ulf W
Ulf Wiger
CTO, Erlang Training & Consulting Ltd

More information about the erlang-questions mailing list