I need to convert a new line in a plain multiline text field in Craft into a comma.
My text looks like:
1 Infinite Loop
Cupertino, CA
and I want to convert it to: 1 Infinite Loop, Cupertino, CA
I tried doing {{ text|nl2br|replace({ '<br>', ', ' })|raw }}
but that didn't work.