简体   繁体   中英

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 \ character 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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM