Sometimes we might want to break down a string datatype value into an array of substrings based on some separator.
A separator can be a space, a comma, a newLine e.t.c
Let’s see how to do that!!!
1.Input is our input String value
2.Result is our output List
3.Separator is the desired delimiter ex: comma, space, hyphen e.t.c
Install “Microsoft.Activities” Package ,if you don’t find the split activity in your activities panel
Implementation using UiPath :
Let’s develop a project which takes a string value consisting of numbers separator by comma and displays the values.
Drag “Assign” activity into the designer panel and initialize the string variable with some sample data as shown below.
numbers_Data = “1,2,3,4,5”
Drag “Split String” activity into the designer panel and supply the below-mentioned parameters.
Drag “For Each” activity into the designer panel and supply the above-created list variable to it.
Then, drag “Message Box” activity to display the values available in the list variable.
Finally, execute the project to display all the values available in the list on by one!!!
Click here to download the Source Code…
Hope it has helped you…