private static bool ParseNCNameInternal(string s, bool throwOnError)
{
int len = ParseNCName(s, 0);
if (len == 0 || len != s.Length)
{
// If the string is not a valid NCName, then throw or return false
if (throwOnError) ThrowInvalidName(s, 0, len);
return false;
}
return true;
}