0

I have a string like this test |firstresult |secondresult |thirdresult

I'd like the output to be a string with a new line for every | available

Expected Output:

test |firstresult |secondresult |thirdresult

I've tried using str.split but the delimeter is lost. I've also tried str.split(/(?=|)/) which doesn't seem to like the | symbol.

Thanks for your help in advance

Leslie Alldridge
  • 1,427
  • 1
  • 10
  • 26

0 Answers0