Merge two line string into single line

Hi,

   This could be a simple thing. But not working for me. I splitted string Using Newline(). Now I want to merge that into one line. Please help me

"|Created by]|
Hello"

 I want output as 

"|Created by]|Hello"

I tried splitting string and then trim and then concat using +. Didn't work.


   

Hi,

Try 

Replace(strings + string2, "\n", "")

Regards,

Daniel

Sankareswari Muthiah wrote:

Hi,

   This could be a simple thing. But not working for me. I splitted string Using Newline(). Now I want to merge that into one line. Please help me

"|Created by]|
Hello"

 I want output as 

"|Created by]|Hello"

I tried splitting string and then trim and then concat using +. Didn't work.


   

Hi Sankareswari,

Please Try

String_Join function to concat the string and after that use Replace 

SyntaxEditor Code Snippet

Replace(String_Join.Text,NewLine(),"")

For your reference 

https://vermaamit52.outsystemscloud.com/Utilities/TestScreen.aspx?_ts=637045747741192699

Hope it will help :)

Thanks,

Amit


Hello Sankareswari, 

May I ask why? 

I mean, why do you add a newline and after wants to show without it? 

Is the information stored in the database with the newline? I would try Daniel method first. 

If not, I would create a function that would receive the two texts and a bollean indicating if the texts should be separet or not by the newline, and return the result accordingly. 

This is one of the recommended (best) practuces: to use a function (server action) to format strings. 

Cheers 

Thanks everyone


I used below and it worked


Replace(strings + string2, Newline(), "")