c# - Utility to convert an arbitrary string to a .NET string -


is there utility out there convert arbitrary (or @ least html doc) string nicely formatted c# string. motivation doing lot of unit tests of html docs, , don't want load them files, rather keep inline strings. love paste html editor, , output reasonably looking c# string. instance:

convert this:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us" xmlns:fb="http://ogp.me/ns/fb#" itemscope itemtype="http://schema.org/"> 

into:

@"<html xmlns=""http://www.w3.org/1999/xhtml"" xml:lang=""en-us"" " + "lang=""en-us"" xmlns:fb=""http://ogp.me/ns/fb#"" itemscope " + "itemtype=""http://schema.org/"">" 

if not, thoughts on corner cases either html or .net strings might issue? sure not simple string.replace("\"", "\"\"") , busting lines every 80 characters....

even plugin notepad++ or other editor work.

how smart paster?

enter image description here

visual studio 2010 version here.


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -