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