[erlang-questions] Conversion of string into Ascii values ??

Bengt Kleberg <>
Thu Feb 28 12:24:03 CET 2008


Greetings,

If you know you have a string the correct way is ~s. As in:

io:fwrite( "jbss msg  ~s~n", [Mymsg] ).


bengt

On Thu, 2008-02-28 at 16:39 +0530, J Bhanot wrote:
> 
> Hi, 
> 
> In following code: 
> 
> add(Mymsg) -> 
>  io:format("jbss msg  ~w~n", [Mymsg]), 
> 
> when I am executing complex3:add(["abc"]).......where complex3 is my
> module name..... 
> 
> I get the output as  
> 
> jbss msg  [97,98,99]........ 
> 
> Why is it coverting abc in ascii value..... 
> 
> Is there a way in which I can get - 
> 
> jbss msg abc 
> 
> Thanks, 
> jb 
> 
> ____________________________________________
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain 
> confidential or privileged information. If you are 
> not the intended recipient, any dissemination, use, 
> review, distribution, printing or copying of the 
> information contained in this e-mail message 
> and/or attachments to it are strictly prohibited. If 
> you have received this communication in error, 
> please notify us by reply e-mail or telephone and 
> immediately and permanently delete the message 
> and any attachments. Thank you
> 
> 
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list