C# code to count number of lines in text box ?
string strtext = textbox1.text;
strtext = strtext.Replace('\r', '\n').Trim();
rslt = 0;
foreach (string s in strtext.Split('\n'))
rslt++;
txtline.Text = rslt.ToString();
I tried that above.. but wrap lines of text box is not included with in count??
Thanks in Advance
4 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sourabh SomaniPosted Jul 7, 2017, 1:12 AM
Sivasankar GorantlaPosted Jul 7, 2017, 12:25 AM
Manikandan MurugesanPosted Jul 6, 2017, 11:59 AM
Vivek KumarPosted Jul 6, 2017, 9:13 AM