How do I remove blank lines?

In the image below, there is a blank line from me doing shift + enter in another programs text box that makes a new line, and then copying and pasting the text into a text box. I use the following code to attempt to remove new lines and compare two strings, one with the extra line and one without. Obviously, this would result in them not equaling each other.

How would I remove the new line to make both strings equal each other?

My current code to remove new lines: (doesn’t work)
v = v:gsub("%s+", ""):gsub("[\n\r]", "")

1 Like

Just tried numerous tests with this gsub and it seemed to work fine to remove all new lines.

string.gsub(str, "\n", "")