Skip to content

Commit 32c1523

Browse files
author
chenxu
committed
Fix if EvaluateString contains ""
1 parent 97d02c8 commit 32c1523

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2924,8 +2924,16 @@ protected virtual bool EvaluateString(string expression, Stack<object> stack, re
29242924

29252925
if (expression.Substring(i)[0] == '"')
29262926
{
2927-
endOfString = true;
2928-
stack.Push(resultString.ToString());
2927+
if (expression.Substring(i).Length > 1 && expression.Substring(i)[1] == '"')
2928+
{
2929+
i += 2;
2930+
resultString.Append(@"""");
2931+
}
2932+
else
2933+
{
2934+
endOfString = true;
2935+
stack.Push(resultString.ToString());
2936+
}
29292937
}
29302938
else if (expression.Substring(i)[0] == '{')
29312939
{

0 commit comments

Comments
 (0)