Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
4
Answers
C# code to count number of lines in textbox ?
Rajavel G
7y
525
1
Reply
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
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
How to my website work in Online and Offline also
How to do save data with showing the Details of Page, Confir