Convert string to list

hello guys I’m new to Ui path

question:-

Manoj
Sachin
Prem
Ravi

output:- {Manoj, Sachin, Prem, Ravi} or [Manoj, Sachin, Prem, Ravi]

need output like this so please help guys

In UiPath Studio, if you want to convert a string to a list in C#, you can use the following code:

string input = "Manoj,Sachin,Prem,Ravi";
List<string> list = input.Split(',').ToList();

However, UiPath Studio uses VB.NET as the default language for expressions. If you want to do this in VB.NET, here is the equivalent code:

Dim input As String = "Manoj,Sachin,Prem,Ravi"
Dim list As List(Of String) = input.Split(","c).ToList()

To use this code in UiPath Studio:

  1. Use an “Assign” activity to set your input string.
  2. Use another “Assign” activity to create the list using the code provided above.
  3. Use the list variable in your workflow as needed.
1 Like

grafik

Assign Activity:
mySplitArray | String Array =

YourStringVar.Split(Environment.NewLine.ToCharArray, StringSplitOptions.RemoveEmptyEntries)
1 Like

Hi @manasdas6224

Attached the workflow of the process. Please check. Hope you will understand.

3.xaml (7.4 KB)

Hope it helps!!
Regards,

1 Like

Thanks bro :slightly_smiling_face:

Thanks :slightly_smiling_face: bro

Thanks bro :slightly_smiling_face:.

@manasdas6224
When it is working, so let’s close the topic by:
Forum FAQ - How to mark a post as a solution - News / Tutorials - UiPath Community Forum

1 Like

actually there is a data in notepad and i want to use loop to extract one by one

Hi @manasdas6224
If the data in notepad file try this below

I hope it helps!!

1 Like

can you please share the main.xaml file

@manasdas6224
Test.zip (141.2 KB)

1 Like

Thanks brother for helping me :slightly_smiling_face:

@manasdas6224
If you find the solution for your issue. Mark as solution to close the loop.

1 Like

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