Substring manipulation of path

path-- C:\Users\Uipathuser\Taxology\Test_Folder_Data_RPA - Documents\Spain\Zürich Invest AG\2018\Zurich Anlagestiftung\Source Data\Forms210

Required path-- C:\Users\Uipathuser\Taxology\Test_Folder_Data_RPA - Documents\Spain\Zürich Invest AG\2018\Zurich Anlagestiftung

How can i do this?

i want to trim that last two folder from path

One of many options:


new DirectoryInfo(YourFolderPathVar).Parent.Parent.FullName

1 Like

There are many ways, RegEx is also a method.

You can use a Assign activity in studio and asign this to a string variabel.

System.Text.RegularExpressions.Regex.Match(“full path”, “^(.*?)\Source”).Groups(0).Value

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