How to remove blank lines from API response?

I’ve tried Find & Replace \n and \n\n.

Screen Shot 2022-12-26 at 4.57.56 PM

When I Find & Replace a return it messes up the formatting for the rest of the text.

Screen Shot 2022-12-26 at 5.00.41 PM

I would like the text to be at the top of the box. How can I do this?

If you need to remove only the newlines at the beginning of a text you can use the operator “trim” when you create the expression. It removes spaces and newlines from the beginning and the end of the text.

If you want to use find and replace you can use this regular expression ^\s+ that selects only spaces and newlines at the beginning of the text.

2 Likes

Thank you so much!!!

great! :slight_smile:

1 Like

I kept getting \n\n at the beginning of an API response. I used find/replace with regex. Here’s what worked ^\n\n.

1 Like

trim is what worked for me. glad you found a solution!