0

How to determine if a number is an integer

Help.

2nd Aug 2020, 10:48 PM
Yellow Keys
Yellow Keys - avatar
2 Respostas
+ 2
Last option is no typical or valid C# option. Try to parse it into an integer and if you go to catch block, it was not an integer... string b = "1"; try { int c = Int32.Parse(b); Console.WriteLine("true"); } catch (Exception e) { Console.WriteLine("false"); }
2nd Aug 2020, 11:17 PM
Sandra Meyer
Sandra Meyer - avatar