开发者

Remove C# Escape Character

I am having a problem when working with VSTO's Evaluate function, that function is basically translating a formula in Excel and return the value.

What I am struggling is if I pass a formula with " character, C# automatically add \ next to it, I do understand why it is there, but it is causing the function to fail since the \ character is trying to get evaluate as well, but if I use the string Replace function to remove the \ character, it works.

However, I cannot just remove \ character, what if the user do type a \ ch开发者_Python百科aracter on a cell? I will remove that regardless and causing my solution to give a wrong answer.

Can anyone help me to resolve that?

I have tried to use the @ sign, doesn't work neither.

Any help would be appreciate.


I suspect that you are just seeing the \ character in the debugger. Nothing that I have ever seen in C# automatically inserts the escape character in any strings. Can you give us some example code?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜