Table of Contents
C#: Trim a newline off of a string (2025-08-06)
Local Backup
TAGS
C#: Trim a newline off of a string (2025-08-06)
Source:
https://stackoverflow.com/questions/1038031/what-is-the-easiest-way-in-c-sharp-to-trim-a-newline-off-of-a-string
Local Backup
The following works for me.<sxj c#>sb.ToString().TrimEnd( '\r', '\n' );</sxh>or
sb.ToString().TrimEnd( Environment.NewLine.ToCharArray());
TAGS
4 person(s) visited this page until now.
Back