public static void AddHeaderField(DataStringCollection source, string name, string theValue) { if (!StringUtils.IsEmpty(theValue)) { theValue = theValue.Replace("\r\n", "\r\n\t"); if (theValue[theValue.Length - 1] == '\t') { theValue = theValue.Substring(0, theValue.Length - 1); } source.AddRange(StringUtils.GetStringArray(string.Format("{0}: {1}", name, theValue))); } }