IsHeaderName() static private method

static private IsHeaderName ( string name ) : bool
name string
return bool
Example #1
0
 private static string checkName(string name)
 {
     if ((name == null ? true : name.Length == 0))
     {
         throw new ArgumentNullException("name");
     }
     name = name.Trim();
     if (!WebHeaderCollection.IsHeaderName(name))
     {
         throw new ArgumentException("Contains invalid characters.", "name");
     }
     return(name);
 }
 private static string CheckName(string name)
 {
     if (name.IsNullOrEmpty())
     {
         throw new ArgumentNullException("name");
     }
     name = name.Trim();
     if (!WebHeaderCollection.IsHeaderName(name))
     {
         throw new ArgumentException("Contains invalid characters.", "name");
     }
     return(name);
 }