Closed cuiliang closed 4 years ago
Hello @cuiliang ,
The easiest way is to use the variable as a variable:
Console.WriteLine(Eval.Execute("str", new { str }).ToString());
Which works fine.
But it looks you are right, we might have a bug with escaping some character. We will look at it.
Best Regards,
Jon
Eval.Execute("str", new {str}) the expression evaluated is "str", not this expression ("Hello"+"\r\n") That's different.
See the following Fiddle: https://dotnetfiddle.net/SPVHmk
It evaluates the expression
Try this=> https://dotnetfiddle.net/IHSosZ
Console.WriteLine(Eval.Execute("\"Hello\" + \"\\\\r\\\\n!\"").ToString()); //should return "Hello\r\n!" but not right.
The expression to evaluate is : "Hello" + "\\r\\n"
Hello @cuiliang ,
The v4.0.4 has been released.
I have updated the Fiddle: https://dotnetfiddle.net/SPVHmk
Let me know if everything now works as expected.
Best Regards,
Jon
@JonathanMagnan Working now, thanks.
I want to generate such result: "Hello \r\n!" (not new line, just origin characters), but can not success. See code example:https://dotnetfiddle.net/2pfmXx