using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Text.RegularExpressions;
using System.Reflection;
public class MainClass{
public static void Main(){
string[] money = new string[] { "$0.99", "$0,99", "$1000000.00", "$10.25", "$90,000.00", "$90.000,00", "$1,000,000.00", "$1,000000.00" };
foreach (string m in money)
{
try
{
Decimal.Parse(m, NumberStyles.Currency);
Console.WriteLine("!{0}: True", m);
}
catch (FormatException)
{
Console.WriteLine("!{0}: False", m);
}
}
}
}
|