String Manipulation to extract email body


I’m trying to extract an email body, but i need only specific data, i need to remove the circled part from email body and remove all extra spaces between can some one help me? E

PS: This is only a sample body, this changes but the spaces and the last three lines are same


Hi @Thulini_Dissanayake,

I could not see the circled part in the screenshot. But you can use the below statement in an assign activity to replace more than one spaces to one space (to remove the extra spaces)

System.Text.RegularExpressions.Regex.Replace(text, “\s{2,}”, " ")

Happy Coding! :slight_smile:


Try this :slight_smile:

Main.xaml (6.2 KB)

Removed * from text.
Removed whitespaces of 2 or more (as per @udhay) and replaced with a single space " ".

I have not hard coded in the words: “Tamba Sumana” incase this changes.
I have also not hard coded in “Dublin 2, Ireland”
If these are constant, the Regex pattern could be improved…

Hopefully this helps :smiley: