I have this for an example
test¶test1¶test2¶test3
This should return 4
However
test¶test1¶test2¶
should return 3 because there is not text after the 3rd newline.
I can do something like
str.split("\n").length
This will only give me the amount of newlines. I’m not sure what to try to just return text between the newlines. Would regex work?
Thanks for any help
1 Answer