Extract text from the paragraph

Hi Guys,

I am trying to extract the string value whats written after a particular text in a UI Element, which could consist of multiple lines like a paragraph.
I am at a point where I have extracted the full text using Get Text Activity, need to know what should be my next step.
I would prefer using string manipulation functions instead of relying on activities.

Below is an example where I am trying to get the user name value i.e. PAVAN from the program, a value which always comes after “User Name :”

Example :

“Please reset below user account password :
Environment : XX1
User Name : PAVAN
Email Address : pavan.shah@123.com

Appreciate if someone can guide a way forward, thanks

@pavshah

First read entire text and assign it to one string variable and say ‘userDetails’. And then try below expression to read required values.

     userName = userDetails.substring(userDetails.IndexOf("User Name : ")+"User Name : ".Length).Split(Environment.NewLine.TocharArray)(0)

Thanks a lot for quick response :

Above assignment rule is working on the first line i guess, its returning :

“t below user account password :”

1 Like

@pavshah Have a look Here and Let me know