[erlang-questions] Re: How to remove \ from string

Anders Nygren anders.nygren@REDACTED
Wed Apr 6 19:46:21 CEST 2011


The backslash is not really part of the string, it is just an effect
of how the shell
presents data.
4> erlang:byte_size(<<"a\"">>).
2

6> io:format("~s~n",[<<"a\"">>]).
a"
ok

/Anders

On Wed, Apr 6, 2011 at 12:36 PM, Muhammad Yousaf
<muhammad.yousaf@REDACTED> wrote:
>
> Thanks a lot but i only want to remove backslash not double quotes
> for example
> Val = <<"{get,\"user\",\"wilson\",\"lname\"}">> ,
> i need Val= <<"{get,"user","wilson","lname"}">>
> what i am doing with your help
>
> re:replace(Val,["\\"],"",[global, {return,list}]). getting error
>
> [X||X<-"{get,\"user\",\"wilson\",\"lname\"}",X=/=$\\].
>
> also dont work on backslash any idea how can i remove only backslashes from
> string or binary
>
> thanks in advance
>
> Regards,
> Muhammad Yousaf
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>



More information about the erlang-questions mailing list