Skip to main content
added 75 characters in body; added 20 characters in body
Source Link
djdd87
  • 68.6k
  • 29
  • 159
  • 198

The QuickWatch/Watch window will add the extra \ in. If you view it in the Text Visualizer, you will not see them:

QuickWatch:

"{ \"data\": { \"urls\": [ {\"url\": \"domain/path1\"} ,{\"url\": \"domain/path2\"} ] }}" 

Visualizer (the actual output):

{ "data": { "urls": [ {"url": "domain/path1"} ,{"url": "domain/path2"} ] }} 

The \ indicates that the quotes have been escaped and will be included in the final string as you're expecting them to be. I.e. there's nothing wrong with your output.

NB. I used "\"" instead of Convert.ToChar(34) when I tested this.

The QuickWatch/Watch window will add the extra \ in. If you view it in the Text Visualizer, you will not see them:

QuickWatch:

"{ \"data\": { \"urls\": [ {\"url\": \"domain/path1\"} ,{\"url\": \"domain/path2\"} ] }}" 

Visualizer:

{ "data": { "urls": [ {"url": "domain/path1"} ,{"url": "domain/path2"} ] }} 

The \ indicates that the quotes have been escaped and will be included in the final string as you're expecting them to be. I.e. there's nothing wrong with your output.

The QuickWatch/Watch window will add the extra \ in. If you view it in the Text Visualizer, you will not see them:

QuickWatch:

"{ \"data\": { \"urls\": [ {\"url\": \"domain/path1\"} ,{\"url\": \"domain/path2\"} ] }}" 

Visualizer (the actual output):

{ "data": { "urls": [ {"url": "domain/path1"} ,{"url": "domain/path2"} ] }} 

The \ indicates that the quotes have been escaped and will be included in the final string as you're expecting them to be. I.e. there's nothing wrong with your output.

NB. I used "\"" instead of Convert.ToChar(34) when I tested this.

Source Link
djdd87
  • 68.6k
  • 29
  • 159
  • 198

The QuickWatch/Watch window will add the extra \ in. If you view it in the Text Visualizer, you will not see them:

QuickWatch:

"{ \"data\": { \"urls\": [ {\"url\": \"domain/path1\"} ,{\"url\": \"domain/path2\"} ] }}" 

Visualizer:

{ "data": { "urls": [ {"url": "domain/path1"} ,{"url": "domain/path2"} ] }} 

The \ indicates that the quotes have been escaped and will be included in the final string as you're expecting them to be. I.e. there's nothing wrong with your output.