Skip to content

Instantly share code, notes, and snippets.

@mikekwright
Created November 5, 2013 05:59
Show Gist options
  • Save mikekwright/7314570 to your computer and use it in GitHub Desktop.
Save mikekwright/7314570 to your computer and use it in GitHub Desktop.
Sample use of double TryParse
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