I am working with emails and outlook activities, however, I wish to delete all of the information beyond the closing of the email at “Kind Regards” in order to not extract the footer and other irrelevant information.
How would I go about this?
An example would be like:
Hi, this order has been cancelled. Kind regards.
(followed by text I wish to delete)
You could use Regex to achieve this. Extract the string as normal and use a matches activity with your extracted string and the following expression:
This returns a type IEnumerable. To return the value to type string, use an assign activity:
Or with a Regex.Replace
myString = Regex.Replace(myString, "(?<=kind\sregards)[\s\S]*", ".", RegexOptions.IgnoreCase)