Reply To: String handling

Home Forums Basic Erlang String handling Reply To: String handling

#67666

Unfortunately, I did not understand exactly what you need. But I’d rewrite the function as follows:

to_rna(List) -> string:join(lists:map(fun(X)->
case string:chr("GCTA",X) of
	1 -> "C";
	2 -> "G";
	3 -> "A";
	4 -> "U"
end end,List),"").