public static IsRomanNumber ( string s ) : bool | ||
s | string | |
return | bool |
public static bool IsRomanNumber(string s)
{
if (string.IsNullOrEmpty(s) || s.Length > 9) return false;
foreach (char c in s)
{
if (c != 'I' && c != 'V' && c != 'X' && c != 'L' && c != 'C') return false;
}
return true;
}