Question:You are writing a method that accepts a string parameter named message. Your method must break the message parameter into individual lines of text and pass each line to a second method named Process. Which code segment should you use? 

A StringReader reader = new StringReader(message);
while (reader.Peek() != -1) {
Process(reader.ReadLine());
}
reader.Close(); 

B StringReader reader = new StringReader(message);
while (reader.Peek() != -1) {
string line = reader.Read().ToString();
Process(line);
}
reader.Close(); 

C StringReader reader = new StringReader(message);
Process(reader.ReadToEnd());
reader.Close(); 

D StringReader reader = new StringReader(message);
Process(reader.ToString());
reader.Close();
 

+ Answer
+ Report
Total Preview: 752

Copyright © 2024. Powered by Intellect Software Ltd