Find and replace a line break ONLY at the beginning of text

In my app I’m making an API call to OpenAI to generate text. I’ve noticed that the response comes back with a hard return (line break) at the beginning of the body text. Thus far, to eliminate this unnecessary line break, I’ve been using the :find & replace function to find a line break, and replace it with [nothing]. This eliminates the problem of line breaks at the beginning of the body text, but it also makes it so there are no line breaks in the rest of the text.

Is there a way I can only have it remove the line break at the beginning of the body text?

Surely there must be some smart people in here that have figured this out! #nudge

Hi there, @dustinstout… check out this post… both suggestions in it will do the trick.

Best…
Mike

1 Like

thanks so much @mikeloc !!

1 Like