[erlang-questions] String pattern matching

mats cronqvist <>
Wed Apr 29 12:45:04 CEST 2009


"Kevin" <> writes:

> Does this behavior make sense to somebody or is this sugar tasting sour?
>
>
> 25> "a"++B = "ab". 
> "ab"
> 26> A++"b" = "ab".
> * 1: illegal pattern
>
>
> I was just looking for an erlangy way to chomp the end of strings, like
>
> NewLine ++ "\r\n" = Line

 I use something like;
string:tokens("blafoo\r\n","\r\n").

  mats



More information about the erlang-questions mailing list