How do I remove the carriage return character (\\r) and the new line character(\\n) from the end of a string?
(\\r)
(\\n)
This should work ...
var tst = "12345\n\n\r\n\r\r"; var res = tst.TrimEnd( '\r', '\n' );