Thanks --- this is almost what I want, except that I would like to
escape everything _but_ the $'s, ie have a string literal like C and
ilk. I think that
macro semiraw_str(s)
parse(string("\"",replace(s, "\$", "\\\$"),"\""))
end
does this but it looks like something that should be taken out and
shot -- de-uglification suggestions are gladly accepted.
Best,
Tamas
On Sun, Apr 26 2015, Sean Marshallsay <
srm....@gmail.com> wrote:
> 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 <
willshi...@gmail.com <javascript:>>