Tamas, you can define a macro `macro raw_str(s) s end` which does what I 
think you want:

julia> macro raw_str(s) s end

julia> raw"This macro \t escapes \n any $special $(characters) for you."
"This macro \\t escapes \\n any \$special \$(characters) for you."



On Sunday, 26 April 2015 13:44:05 UTC+1, Tamas Papp wrote:
>
> Maybe something like 
>
> julia> s = "my \\ escaped \\\$ \$ string" 
> "my \\ escaped \\\$ \$ string" 
>
> julia> replace(s, "\\\$", "\$") 
> "my \\ escaped \$ \$ string" 
>
> Best, 
>
> Tamas 
>
> PS.: Incidentally, is there a way to enter strings with $ without 
> escaping them? Ie something like a non-standard string literal that just 
> ignores the $'s. 
>
> On Sun, Apr 26 2015, will ship <[email protected] <javascript:>> 
> wrote: 
>
> > Hi 
> > 
> > I am reading in a text file with special characters e.g. : " Blah is 
> $LBP" 
> > when I read it in to a variable the "$" gets replaced with "\$". But I 
> > actually want the $ non-escaped so that when handling the string 
> variable 
> > it prints the $LBP value. 
> > 
> > Is there anyway of doing this, our just to remove the "\" in the string 
> > without removing the "$" as well? 
> > 
> > Thanks in advance. 
> > 
> > Will 
>

Reply via email to