[erlang-questions] bit syntax or tokens ?

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Fri Jul 2 23:38:03 CEST 2010


On Fri, Jul 2, 2010 at 11:32 PM, info <info@REDACTED> wrote:
> Given a string S = <<"ABC,DE,FGH">>.
> I do
> <<Alpha:24,_:8,Beta:16,_:8,Gamma:24>> = S.
> and
> Alpha. gives 4276803

This is an excellent case for the new R14A/EEP-31 binary module,
presumed I understand your question:

3> binary:split(<<"ABC,DE,FHG">>, <<",">>).
[<<"ABC">>,<<"DE,FHG">>]


-- 
J.


More information about the erlang-questions mailing list