public static void RemoveHeaderField(StringCollection source, HeaderFieldList fieldList, HeaderField field) { if (field != null) { fieldList.Remove(field); int index = int.Parse(field.Value); source.RemoveAt(index); while (index < source.Count) { if (StringUtils.IsEmpty(source[index]) || ((source[index][0] != '\t') && (source[index][0] != ' '))) { break; } source.RemoveAt(index); } } }
public static void RemoveHeaderField(ArrayList source, HeaderFieldList fieldList, string name) { HeaderField field = fieldList[name]; if (field != null) { fieldList.Remove(field); int index = int.Parse(field.Value); source.RemoveAt(index); while (index < source.Count) { string str = (string)source[index]; if (StringUtils.IsEmpty(str) || ((str[0] != '\t') && (str[0] != ' '))) { break; } source.RemoveAt(index); } } }