How do I split a string (passage) to two by another little string like a word or a sentence

Hello All,

So I have to split a paragraph into two so I can use the first part for processing and for that I have a specific word up to which I want the data. Let me give you an example.

Suppose there is an email trail and I want only first part of the trail, upper part till “Thanks and Regards”, so I can break the processing there and use the first part for processing, like to find the numbers or something.

Please help me on this guys.

Thank you for your time.

Tanveer

1 Like

Hi
Welcome back to uipath community
Yah we can do that
Let’s say like we need to get till “Thanks and Regards”
Then use this expression in a ASSIGN activity
stroutput = System.Text.RegularExpressions.Regex.Match(strinput.ToString,”.*(?=Thanks and Regards)”).ToString

Cheers @Tanveer_Shaikh

1 Like

Hi @Palaniyappan, Thank you for helping. Well it executed but there is no result, its just blank. Please help

1 Like

Actually, one of my collogues helped me. getting the index of the word (eg: Regards) by which you want to separate and then printing the substring up to that index.

Thank you.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.