I am using Visual Studio 2010 and have a breakpoint set to stop execution of the app after a variable is set with contents of a large XML string. I want to replace the contents of the string with a different XML string. I open the Text Visualizer but it does not allow me to modify the string. How can I change the contents of the variable? I have the variable displayed in a Watch Window but only the first line of the string is copied.
My workaround for this:
Copy the text from Text Visualizer to notepad:
<table xmlns="http://www.w3schools.com/furniture">
<name>African Coffee Table</name>
<width>80</width>
<length>120</length>
</table>
Edit the value according your needs:
<table xmlns="http://www.w3schools.com/furniture">
<name>African Coffee Table</name>
<width>100</width>
<length>200</length>
<weight m="kilo">12</weight>
</table>
Replace all "
with ""
:
<table xmlns=""http://www.w3schools.com/furniture"">
<name>African Coffee Table</name>
<width>100</width>
<length>200</length>
<weight m=""kilo"">12</weight>
</table>
Assign the new value to the variable using verbatim string literal @""
, e.g.
myXml=@"<table xmlns=""http://www.w3schools.com/furniture""> <name>African Coffee Table</name> <width>100</width> <length>200</length> <weight m=""kilo"">12</weight> </table>"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With