Newtonsoft.Json.Converters.XmlNodeConverter.IsNamespaceAttribute C# (CSharp) Метод

IsNamespaceAttribute() приватный Метод

Checks if the attributeName is a namespace attribute.
private IsNamespaceAttribute ( string attributeName, string &prefix ) : bool
attributeName string Attribute name to test.
prefix string The attribute name prefix if it has one, otherwise an empty string.
Результат bool
    private bool IsNamespaceAttribute(string attributeName, out string prefix)
    {
      if (attributeName.StartsWith("xmlns", StringComparison.Ordinal))
      {
        if (attributeName.Length == 5)
        {
          prefix = string.Empty;
          return true;
        }
        else if (attributeName[5] == ':')
        {
          prefix = attributeName.Substring(6, attributeName.Length - 6);
          return true;
        }
      }
      prefix = null;
      return false;
    }