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?
visual studio 2010 version here.
Comments
Post a Comment