How can i remove carriage return in a string that contain just the empty line

I have a string variable contain:
1
2

3
4
There is an empty line between 2 and 3. I have tried using .Replace(Environment.NewLine,"") but the output is “1234”

How can i remove the carriage return so that the final output will be.
1
2
3
4

you have shown here as an array if it is a string it should be like 123 4 then if you use string,replace(" “,”") it will work

1 Like

The string is made up of:
"1" + Environment.NewLine + “2” + Environment.NewLine + Environment.NewLine + “3” + Environment.NewLine + “4” + Environment.NewLine

Could you replace an occurances of + Environment.NewLine + Environment.NewLine with just + Environment.NewLine as the gap will be made of 2 + Environment.NewLine together.

Sorry if thats a rubbish suggestion

1 Like

See this -

Main.xaml (5.7 KB)

1 Like

@PrankurJoshi Isn’t the problem that he needs to keep the new lines between numbers so that they are all on a new line but without the gap between 2 and 3. Your workflow puts them all together (I will shut up if I’m talking rubbish!)

2 Likes

@charliefik please speak you are so right. My bad. @alfredgoh attached is the updated one

Main.xaml (5.7 KB)

2 Likes

@alfredgoh check once below one also.

flow----.xaml (6.0 KB)

1 Like