How to add Semicolon(;) in between emails Id's in text file

Hi Team,

I want to add Semicolon ( ; ) in between emails Id’s in text file,and this this text file email id’s i want to use as variable in Send Exchange Email Message activity in TO property.

Text file data as below

trajesh@gmail.com
Claims@life.co
Customercare@hotmail.com

2 Likes

Hi
Hope this expression would help you resolve this
If the above string is with a variable named str_input
Then

Str_output = String.Join(“;”,Str_input.Split(Environment.NewLine.ToArray())).ToString

Cheers @RajeshT

2 Likes

Hi @Palaniyappan,

Thank you for the reply.

Its adding two semicolons in between each email id.
image

1 Like

Appreciate your help @Palaniyappan

1 Like

Fine is that mail if having semi colon with them already
If so
Then the expression be like this
Str_output = String.Join(“”,Str_input.Split(Environment.NewLine.ToArray())).ToString

Cheers @RajeshT

1 Like

Hi @Palaniyappan,

The text file doesn’t have no semicolons ,but still its showing two semicolons.
Please check my text file and xaml.TextFileValidation.zip (1.5 KB)

1 Like

i got the issue buddy
mention the expression like this
Str_output = String.Join(“;”,Str_input.Split(Environment.NewLine.ToArray(),StringSplitOptions.RemoveEmptyEntries)).ToString

this worked when i tried to simulate this
Cheers @RajeshT

2 Likes

This works fine @Palaniyappan.
Thanks a ton!!

1 Like

Cheers @RajeshT

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