Hey guys,
How can I detect line breaks on a text or textbox?
I don't want to detect the characters, just the line breaks.
Example:
This i a test.
Line breaks: 0
This is a test.
This is another test.
Line breaks: 1
Thanks!
tokencount(text, newline)-1
You can wrap text in trim() expression to remove any line breaks at the end:
tokencount(trim(text), newline)-1
Thanks bro!!! :)
dop2000
Last question:
Is there any way to detect what/where line is a character in the text?
TEXT
A
B
C
FIND:
RESULT: LINE 2
Develop games in your browser. Powerful, performant & highly capable.
You can compare each line in a loop using tokenat expression. There may be an easier way with regex, but I don't know it.
No problem, thanks again for your time!