I’d like to seek to an arbitrary point in a character stream and then get the corresponding line number. In Java, this can be handled transparently with the java.io.LineNumberReader.getLineNumber() method.
What’s the best way to go about this in C#?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There isn’t anything like that in .NET Use the ReadLine() method and track the line numbers yourself.