User Tools

Site Tools


note:prog:csharp:250806:001:index

C#: Trim a newline off of a string (2025-08-06)

Local Backup

  • The following works for me.<sxj c#>sb.ToString().TrimEnd( '\r', '\n' );</sxh>or
    sb.ToString().TrimEnd( Environment.NewLine.ToCharArray());

TAGS

  • 2 person(s) visited this page until now.

note/prog/csharp/250806/001/index.txt · Last modified: 2025/08/06 08:14 by jethro