using System;
namespace MyCompiler {
class Program {
public static void Main(string[] args) {
double a;
bool r;
// r = double.TryParse(" 1.2 ", out a); // True, 1.2
// r = double.TryParse(" -1.2 ", out a); // True, -1.2
// r = double.TryParse("+1.2", out a); // True, 1.2
// r = double.TryParse(null, out a); // False, 0 <-- the difference from Convert.ToDouble
// r = double.TryParse(" 1,200 ", out a); // True, 1200
// r = double.TryParse(" 1,2 ", out a); // True, 12
// r = double.TryParse("", out a); // False, 0
// r = double.TryParse(" ", out a); // False, 0
// r = double.TryParse("- 1.2 ", out a); // False, 0
// r = double.TryParse("+ 1.2", out a); // False, 0
// r = double.TryParse("1 .2", out a); // False, 0
// r = double.TryParse("1.2a", out a); // False, 0
// r = double.TryParse("a1.2", out a); // False, 0
Console.WriteLine($"{r}, {a}");
}
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: