Check Column and Line in a TextBox [ASK]

How to check amount of lines in a TextBox?

Use string.split()

local textbox = path.to.textbox
local splittedText = textbox.Text:split("\n")
local lineCount = #splittedText

print("Theres "..lineCount.." lines in the textbox.")

Lets image that textbox value is this
image

when we execute the code, it will print 2 since its have 2 lines.
image

1 Like