[erlang-questions] binary strings and interspersing erlang variables
Wes James
comptekki@REDACTED
Sun Mar 11 00:16:38 CET 2012
On Sat, Mar 10, 2012 at 2:08 AM, Erik Søe Sørensen <eriksoe@REDACTED> wrote:
> For completeness, I'll provide an answer which is closer to the original -
> and constructs a binary:
> The strings need not be marked as binaries; you can just put the string
> literals directly inside a binary constructor:
>
> <<"<html>
> <head>
> <script>
> port='",
>
>
> Port/binary,
> "';
> </script>
> </head>
> <body>
> </body>
> </html>">>
<snip>
Thanks - learn something new all the time :)
I tried it and it work great!
-wes
More information about the erlang-questions
mailing list