Advertisement
f0rkB0mb

Hết Giấy NewlineReplace

Jan 11th, 2013
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.37 KB | None | 0 0
  1. public static class StringExtensions
  2. {
  3.     public static string RemoveLineBreaks( this string lines )
  4.     {
  5.         return lines.Replace( "\r", "").Replace( "\n", "" );
  6.     }
  7.  
  8.     public static string ReplaceLineBreaks( this string lines, string replacement )
  9.     {
  10.         return lines.Replace( "\r\n", replacement )
  11.                 .Replace( "\r", replacement )
  12.                 .Replace( "\n", replacement );
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement