Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 C#,我正在验证两个应该完全相同的日志文件的文本。例外是一个日志文件附加"= :::"到每一行的末尾,这会导致验证失败。
"= :::"
有没有办法验证两个文档的内容,但从验证中排除该特定字符串?
如果第二个文件放在里面x,你可以做
x
x.Replace("= :::\n", "\n");
这将适用于除最后一行之外的所有行,因此您可以为最后一行
x.remove(x.LastIndexOf("= :::\n"));