How can I separate the values of one String with a new Line?

Hello everyone,

I need help!
I have a String with the value from many Excel Rows.
For example the variable “MobileNumbers” with the value (type String) “12345,12345,12345,12345”.
How can I replace the “,” with a newline?
So I get the following output:
12345
12345
12345
12345

Thanks in advance!
Dennis

@bibalesecret
Welcome to the forum

grafik

e.g. String.Join(Environment.NewLine,yourStringVar.split(","c))

1 Like

@bibalesecret Welcome to uipath forum you can use achieve by using replace string

       assign str_data =     str_data.Replace(",",Environment.NewLine)

1 Like

That is exactly what I needed, thank you very much Peter!

I don’t know if I need to add a new topic for the following question, but can you help me here either?:

Now I have the output
12345
12345
12345
12345
How can I let the robot count the values from 1) to xy)
So it looks like this:

  1. 12345
  2. 12345
  3. 12345
  4. 12345
  5. 12345

Thanks in advance!

Thank you very much, Indra!
This worked very well too :slight_smile:

better to open a new topic. When 1 Topic = 1 case other researchers can find quicker solutions for a similar request

If We got you right you was looking for?

String.Join(Environment.NewLine,YourVar.split(","c).select(Function (x,i) (i+1).toString & ". " & x ))

1 Like

Okay, I will open a new topic next time.

You’re awesome, Peter. This worked well for me :slight_smile:

Have a great day.
Dennis

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