Text in new line, get in one single line

Hi
I have a series of text which I will be getting from Salesforce, that is the Address of Customer which they will be put in one line and sometimes in multiple lines.
I want after extracting the address that everything to be in one line as I have to put the data in SAP, because if its in multiple lines, it will write in multiple text boxes.

So, scenario is, if the text is in two lines, it will put in Stree3 and Street/House Number which I do not want.
So, it should come in one line so I can put it in just one line in Street 3.

Suppose Address is : Address: Apt 6E Kennedy Court
7A Shiu Fai Terrace

It should be like : Address: Apt 6E Kennedy Court7A Shiu Fai Terrace.

I am trying to do replace operation , but it is not yielding me the required result.
–> Address.Replace(Environment.newLine,"")

Main.xaml (4.7 KB)

Attached is the xaml file.

Try Assigning the Address like this and check

Please use this

String.join("",Address .Split({Environment.NewLine,vbcrlf,vblf,"",vbtab,vbcr,vbNewLine},StringSplitOptions.RemoveEmptyEntries))

2 Likes

Hi
i would go with nadim warsi
but with a small correction
stroutput = String.Join(" ",Split(Strinput.ToString,Environment.Newline.ToArray(),StringSplitOptions.RemoveEmptyEntries))

Cheers @Heena_Saini