Substring from a Foldername

Hi everyone,

I have several folders with the following structure (the last part of the folder is also the e-mail address: C:\XYZ\2020\January\newsletter@uipath.com

I loop trough the folders, and if certain conditions apply in documents in this folder then I need to send an e-mail. Therefore I need to extract the last part of the folder (beginning from the last backslash “” until the rest of the right of the String) to use this part as the email-address.

How would the substring or RegEx look like? I need the following result in this example: newsletter@uipath.com

Unfortunately I am not that familiar with the syntax.

Many thanks
Robert

1 Like

Hi
welcome to uipath community
if the above string is in a variable of type string named str_input
then use a assign activity to get the output
str_output = Split(str_input,"\").Last().ToString.Trim

where str_output is a variable of type string

Cheers @Robert_Heggio

2 Likes

Hi Palaniyappan,

you made my day, it works! Thank you so much!!

Best regards,
Robert

1 Like

have a great day… :slight_smile:
@Robert_Heggio

1 Like