Find line feed and replace with a character

I would like to take a string from a widget and remove the line feed so the resultant string is all on one line. I have played with the string functions but can’t quite figure it out. Any help would be appreciated.

Example:
A widget contains the following text with two strings on two lines:
String
Another String

I would like to convert that text to the following:
String, Another String

Essentially removing the line feed and replacing it with a comma.

Thanks in advance.

Try this:

[[SomeStringWithLineBreak.replace('\n',', ')]]

That replace the newline character with a comma followed by a space.

1 Like

That worked. Thanks!

I thought that was one of the first things I tried but I must have had my object syntax wrong. Thanks again!