In this post, we will convert a comma separated string to an array using the UiPath Studio. For example, you have a string “hi,bye,up,down,left,right
” that you need to convert to an array [“hi”,”bye”,”up”,”down”,”left”,”right”].
Prerequisites
Create the Process
Add an Assign
activity and name the variable str1
of type String. Assign this variable with value “hi,bye,up,down,left,right
“.

Add another Assign
activity and name the variable array1
of type System.String[]
.

Assign array1 with the following value.
str1.split(","c)

Our string array is ready. Now, we need to print each element of an array on the console. Add For Each
activity as shown below.

We have used Write Line
activity to print each element of array on the console. Below is how the complete sequence looks like.

Output

You must be logged in to post a comment.