string s = Console.ReadLine();
while(s != null)
{
// do something
// ....
s = Console.ReadLine();
}
The code above is to get the input, verify it, process it and then input again, but obviously, s = Console.ReadLine(); is code duplication.
What tricks are there to avoid the duplication?
whilestatement unless you do a while(true)do-whileloop that is useful for situations like this.