Need to read one character at time until 10 characters reached
<p>I am working on a homework assignment, beginning C#.</p>

<p>Have to accept input from user:</p>

<ul>
<li>phone number with numbers or characters</li>
<li>then return only the numeric version of number.</li>
</ul>

<p>My program takes input and returns value, but does not end when 10 characters have been entered.
You can enter as many characters as you want, then when enter is pressed it only displays first 10.
It also does not test the cases after each character entered. Seems to do at the end.
I would like to have each character tested after input and then once ten characters have been entered
the program display results.</p>

<p>I hope I am giving enough info. I am pretty stressed about this.
It is due tomorrow and I have a few other programs to do yet.
Any help would be greatly appreciated.</p>

<p>My code:</p>

<pre><code>Console.Write("Please enter your phone number: ");
        do
        {
            int temp = Console.Read();
            input = Convert.ToChar(temp);
            //int tempInput = Convert.ToString(tempInput);
            switch (input)
            {
                case '0':
                    alphaNumericPhoneNumber += input.ToString();
                    numericPhoneNumber += input.ToString();
                    counter--;
                    break;
// { other cases }
                default:
                    // if input does not match cases then loop returns to 
                    // request new input
                    Display.Error(input.ToString());
                    Console.Write(alphaNumericPhoneNumber);
                    //Display.Continue();
                    //Console.Clear();
                    input = ' ';
                    break;
            }
        }
        while (numericPhoneNumber.Length &lt; 0);
        return numericPhoneNumber;
    }
</code></pre>
