合并两个rtf文件, 多个\r\n在rtf中等于一个, 可使用\par标记换行
private static string CombineRtf(string rtf1, string rtf2) { rtf1 = rtf1.Trim(); rtf2 = rtf2.Trim(); rtf1 = rtf1.Substring(0, rtf1.Length - 1); // 去除尾部 "}" List<string> list2 = rtf2.Split('\n').ToList(); list2.RemoveAt(0); list2.RemoveAt(0); // 去除前两行描述头 list2.RemoveAt(list2.Count - 1);// 去除尾行 "}" return $"{rtf1}\\par\\par\\par\\par\n{string.Join("\n", list2.ToArray())}}}\\0"; }
标签:文件,par,rtf,string,合并,list2,rtf1,rtf2 From: https://www.cnblogs.com/leavind/p/17549724.html