Monday, November 3, 2014

Change out a value in XML with Regex!

public static String ChangeStatusAtPayload(String stuff, String status)
{
   var regex = new Regex("<Status>.*</Status>");
   Match match = regex.Match(stuff);
   String piece = match.Value;
   return piece.Replace(statusValue, String.Format("{0}", status));
}

No comments:

Post a Comment