I am searching for a string in a textbox in my web application. My output must be the line number of where the string can be found in the textbox.
To find the string in the textbox i am using IndexOf (which helps me make sure if the string is in the textbox or not). I know that if the string is in the textbox it will give me the number of characters as to where the string is.
Now is there a way of finding the line number???
(I was thinking that i go through the textbox starting from the first character all the way to string and as i pass by i check if there is a newline, but i dont know how to check if there is a new line in a textbox)