[erlang-questions] Re: problem with string:tokens

info info@REDACTED
Wed Jul 1 01:02:35 CEST 2009


Oh Oh very good ! I didn't think to the re module.
Thank you so much
> It is a general question of course ! the tokens function cannot
> separate the tokens with a composite string unfortunately (here ",,")

As its name suggests, it *doesn't* behave like the more common "split"
function in other languages.

Have you tried the re module? For example:

   > re:split("A,,C,D", ",", [{return,list}]).
  ["A",[],"C","D"]

   > re:split("A,B,,D", ",", [{return,list}]).
  ["A","B",[],"D"]


________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org


More information about the erlang-questions mailing list