[erlang-questions] Split string in nested list
Fri Feb 11 18:05:28 CET 2011
On 02/11/2011 08:50 AM, shk wrote:
> I have list of next view:
> How can i split by '@" this list?
> I need following:
> [["admin", "localhost"], ["localhost", "localhost"], [user, localhost]]
> Thank you.
Is the list ["admin@REDACTED", "localhost@REDACTED", "user@REDACTED"]
or the one you wrote? They are different; yours is a list of lists, each
of which is a list with one element (the string), while mine is a list
Either way, lists:map/2 should suffice to help convert the list; you
will need to unpack your inner lists within the map fun to get your
Distributed Systems Engineer / DJ MC_
2600hz | http://2600hz.com
More information about the erlang-questions