Detect if there is a new line in a textbox

The question is straight forward, I want to see if there is a new line in a textbox. I am using multiline for this. And when I try to find a number in my textbox using split with a space, the multiline messes me up.

1 Like

I believe you can use string.find(textBoxText, "\n"). Not sure how escape characters work in this case though.

Edit:
If you want to remove new lines you can probably do this:

local textBox -- The TextBox

-- Replaces "\n" with ""
local textNoNewLines = string.gsub(textBox.Text, "\n", "")
1 Like