This will trim off any combination of carriage returns and newlines from the end of s
:
s = s.TrimEnd(new char[] { '
', '
' });
Edit: Or as JP kindly points out, you can spell that more succinctly as:
s = s.TrimEnd('
', '
');
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…