User Tools

Site Tools


note:prog:csharp:250806:001:index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

note:prog:csharp:250806:001:index [2025/08/06 08:14] (current)
jethro created
Line 1: Line 1:
 +====== 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]]
 +  * {{:​note:​prog:​csharp:​250806:​001:​pasted:​20250806-081337.png?​300}}
 +====== Local Backup ======
 +  * The following works for me.<sxj c#>​sb.ToString().TrimEnd( '​\r',​ '​\n'​ );</​sxh>​or<​sxh c#>​sb.ToString().TrimEnd( Environment.NewLine.ToCharArray());</​sxh>​
 +===== TAGS =====
 +  * 
 +====== ======
 +  * {{counter}} person(s) visited this page until now.
 +  * [[:​prog:​csharp:​index|Back]]
 +====== ======
 +<​html><​!-- ​
 +PDF for A4-Portrait:​ {{pdfjs 50%,450px > xxx.pdf?​page-fit}}
 +PDF for A4-Landscape:​ {{pdfjs 500px,700px > xxx.pdf?​page-fit}}
 +PDF for iPad Note: {{pdfjs 700px,500px > xxx.pdf?​page-fit}}
 +
 +Youtube: {{youtube>​large:​XXXXX}}
 +Code Highlight: <sxh php; first-line: 70; highlight: [89,92]; title: New title attribute in action>
 +
 +--></​html>​
  
note/prog/csharp/250806/001/index.txt ยท Last modified: 2025/08/06 08:14 by jethro