Have you tried using regex?
Basically, this should do the trick;
replaceAll($StringToReplace/Input, '(\r\n|\r|\n)', ' | ')
Alternatively, you could also try with doing the linebreak in the logic itself;
replaceAll($StringToReplace/Input, '
', ' | ')
The built in replaceAll method doesn’t work across lines.
You need to use the RegexReplaceAll Java action in Community Commons.
If you start your regular expression with (?s) it will toggle multiline matching.
Good luck!
Thanks for the replies, RegEx did the trick!