formatting strings with backslash

前端 未结 4 731
闹比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:39

    I'm guessing you're looking at the values in the debugger and seeing that they have two slashes.

    That's normal. The debugger will show two slashes even though the actual string representation will only have one. Just another hump to get over when getting used to the debugger.

    Be assured that when you actually use your strings, they will still only have a single slash (using either of your methods).

提交回复
热议问题