bit syntax or tokens ?

info info@REDACTED
Fri Jul 2 23:32:16 CEST 2010


Given a string S = <<"ABC,DE,FGH">>.
I do 
<<Alpha:24,_:8,Beta:16,_:8,Gamma:24>> = S.
and
Alpha. gives 4276803

How to find the string ABC from Alpha ?

The bix syntax seems to be better in Erlang but is it a good approach to extract string fields from a string  or is it better to use the tokens ?

John


More information about the erlang-questions mailing list