How to spilt string using multiple delimiters and loop over them?

Can anyone assist me in below scenario?

I have to read folder names from excel file and using for each loop have to create folder in web application however the problem i m facing is how to let BOT read each item from the excel cell separated by “/” or " " and use unique name create folder in web application.

I have tried using row(“FolderName”).ToString.Split(CChar("/")) in For each Loop but it is not working

Below is the column name and values.

FolderName
TestFolder
TestFolder1
Folder1/Folder2

You can split on “/” or " " this way:

row("FolderName").ToString.Split(New Char() { "/"c, " "c }).

4 Likes

Use If condition
If row(“FolderName”).ToString.contains("/")
Then
FolderArray=row(“FolderName”).ToString.Split("/"c)
It will be create an array
so say For Folder1/Folder2 : It will give u
FolderArray(0)-Folder1
FolderArray(1)-Folder2

1 Like

Thank you! :slight_smile: Problem resolved.

Your Welcome!
Please mark it as solution and close the topic.

Happy Automation :blush:

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