Assign List to String to separate lines

Hi,

I have StrList as List variable and I want to create txt file with it.
If i put StrOUtput = string.Join (vbtab, strList) (StrOUtput is String variable)
I have
9035399460 9035399461 9035399462 9035399463 9035399464
in txt file. But I need format as below
9035399460
9035399461
9035399462
9035399463
9035399464

I need every value on a separate line. Can you please help me?

1 Like

Hi @Katerina_Chabova,

Try adding a newline to the string, something like this should work (not tested):

StrOUtput = string.Join (vbtab + "\n", strList).

Hi,
no this give me
9035399460 \n9035399461 \n9035399462 \n9035399463

Hi
Welcome to uipath community
This expression would help you
Stroutput = String.Join(Environment.Newline,listvariable).ToString

Cheers @Katerina_Chabova

2 Likes

TextFormat.xaml (6.3 KB)
cheers @Katerina_Chabova


cheers @Katerina_Chabova
as @Palaniyappan mentioned you can use that before you have to split based on spaces because you have a string and we need to have ArrayOfString

That is it. Thank you

@Palaniyappan’s answer is the correct one, I was wrong, you should use Environment.NewLine instead of "\n".

use For each loop in your variable StrList and inside loop use assign stroutput=item+environment.newline+stroutput

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