Reply To: String handling

Home Forums Basic Erlang String handling Reply To: String handling

#67664

Using io_lib instead of io “solved” the problem. Here’s the corrected last pattern match:

to_rna([N|T]) ->
    N1 = io_lib:format("~c", [N]),
    N2 = lists:nth(1, N1),
    lists:flatten([to_rna(N2), to_rna(T)]).

Please point out if there’s a better, more idiomatic and/or performant solution.