Created
November 5, 2013 05:59
-
-
Save mikekwright/7314570 to your computer and use it in GitHub Desktop.
Sample use of double TryParse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static double GetResponse() | |
{ | |
double result; | |
do | |
{ | |
Console.Write("Enter a double: "); | |
} while (double.TryParse(Console.ReadLine(), out result)); | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment