Suppress escaped line breaks in VS Immediate Window
In the Immediate Window of Visual Studio you can use format specifiers1 like nq
to suppress the escaping of line breaks and quotes. They are also supported in the Watch window.
?MyObj.ToString(),nq
2
Newtonsoft.Json.JsonConvert.SerializeObject(MyObj, Formatting.Indented),nq
or
System.Text.Json.JsonSerializer.Serialize(MyObj, new JsonSerializerOptions() { WriteIndented = true }),nq
References:
1: Format specifiers in C# in the Visual Studio debugger VS2022
2: Newlines in the Immediate Window