regex - Get specific Value as String c# -
simple:
i messagebody xitem.body
:
"<html>\r\n<head>\r\n<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\r\n</head>\r\n<body>\r\ndies ist test nummer 3\r\n</body>\r\n</html>\r\n"
and need save content between <body>\r\n \r\n</body>
like:
m_description = xitem.body;
what's easiest! way ?
thanks feedback regarding external tool. use in future now, problem coded function:
private string extractbetweenbodytags(string str1) { if ( ! string.isnullorempty(str1)) { int p1 = str1.indexof("<body>\r\n"); if (p1 >-1) { string str2 = str1.substring(p1 + "<body>\r\n".length); int p2= str2.indexof("\r\n</body>"); if (p2 > -1) { str2 = str2.substring(0,p2-1 ); return str2; } } } return ""; }
and had no problems using it.
i think can close :)
Comments
Post a Comment