RosettaCodeData/Task/Determine-if-a-string-is-numeric/Nemerle/determine-if-a-string-is-numeric.nemerle
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

19 lines
450 B
Text

using System;
using System.Console;
module IsNumeric
{
IsNumeric( input : string) : bool
{
mutable meh = 0.0; // I don't want it, not going to use it, why force me to declare it?
double.TryParse(input, out meh)
}
Main() : void
{
def num = "-1.2345E6";
def not = "abc45";
WriteLine($"$num is numeric: $(IsNumeric(num))");
WriteLine($"$not is numeric: $(IsNumeric(not))");
}
}