formatting strings with backslash

前端 未结 4 679
闹比i
闹比i 2021-01-22 22:15

I\'m a newbie to c# so hopefully this one isn\'t too hard for a few of you.

I\'m trying to build a string that has a \\ in it and I am having difficulty getting just one

4条回答
  •  执念已碎
    2021-01-22 22:49

    If you're looking at these strings in the debugger (i.e., by hovering the mouse over the variable or using a watch), the debugger adds escape characters to the display string so that it's a valid string expression. If you want to view the string verbatim in this fashion, click on the magnifying glass on the right side of the tooltip or watch entry with the string in it.

提交回复
热议问题