iOS shortcuts Text


#1

Hi,

I’m trying to work out how to remove empty lines from a Siri shortcuts text.

Example the text being inserted reads like this

One.
——-

Two.
Three.
——-

Four.

I want the text returned to be

One.
——-
Two.
Three.
——-
Four.


#2

Try this. Replace consecutive new lines with 1.


#3

I ended up finding another way that gets the same result.


#4

Aside from empty not being the same as blank, if you want to also account for a final line being blank/empty after a populated penultimate line, this addition should address that.

Hope that helps.