Number of lines in string text

Hello,

I used a get full text on a conversation on a messenger. I would like to get the number of lines on it.
I have tried using: inputstr.Split({Environment.NewLine}, StringSplitOptions.None).Count.ToString but it didn’t give me an accurate number.
An example is below.

Inputstr:
Jason
Hello
0
8:45am
Brad
What are you doing
0
8:50am
Jason
Nothing much,
Wondering what you are up to.
1
8:55am

and the outputstr I would like is
Outputstr: 13

13 represents 13 lines of text in the string.

splitString.xaml (4.4 KB)

Split(inputStr,Chr(10)).Length.ToString

Try this @dvn

Thanks!

2 Likes