Please help me on this

Can someone let me know how to extract string between ‘_’ and ‘. xlss’ from the below example.


I need 00ABCD only, no matter how many characters are there in middle of ‘_’ and ‘.xlss’

Please suggest.

1 Like

Can you try assign activity with System.text.regularexpressions.regex.match(“your string”,“_(.*).xlss$”).groups(1).tostring


Welcome back to UiPath forum
If your input is in a string variable named Strinput
Then use a assign activity and mention the below expression

Stroutput = Split(Split(Strinput.ToString,”.”)(0),”_”)(1).ToString.Trim

Hope this would help you resolve this


1 Like


Let’s say inputString =“Invoice_00ABCD.xlss”

            outputString = inputString.Split("_"c)(1).Split("."c)(0).Trim

Hi @Raj_Sekhar

This will be another approach,

strText - your input string



Thank you it worked

Thanks @lakshman


Glad I could help. Happy Automation :grinning: