How can I determine if a list is a just a string or a list of strings?
How you do it depends a lot on what you plan to do with the result, or rather how you plan to do it. So if you are interested in the bits:
case MyVar of
[First|Rest] when is_list(First) -> ... First,Rest ...;
_ -> ... MyVar ...
end
or if you are not interested in actually pulling apart the string/list of strings you could do:
if is_list(hd(MyVar)) -> ... ;
true -> ...
end
Have I understood you correctly here? I have not put any code in to actually check that what should be strings actually are strings, this should have be done earlier. an alternative would be when generating this string/list of strings to always put it into one of the formats.