Parse attributes from MvcHtmlString
问题 I need to be able to parse the attributes from an MvcHtmlString (the results of an HtmlHelper extension), so that I can update and add to them. For example, take this HTML element: <input type="text" id="Name" name="Name" data-val-required="First name is required.|Please provide a first name."> I need to take the value from data-val-required , split it into two attributes with the second value going into a new attribute: <input type="text" id="Name" name="Name" data-val-required="First name