Skip to content

Instantly share code, notes, and snippets.

@isawrub
Created September 8, 2015 12:02
Show Gist options
  • Save isawrub/f1e6881198861238935b to your computer and use it in GitHub Desktop.
Save isawrub/f1e6881198861238935b to your computer and use it in GitHub Desktop.
NewLine Extensions
public static class StringExtensions
{
public static string RemoveLineBreaks( this string lines )
{
return lines.Replace( "\r", "").Replace( "\n", "" );
}
public static string ReplaceLineBreaks( this string lines, string replacement )
{
return lines.Replace( "\r\n", replacement )
.Replace( "\r", replacement )
.Replace( "\n", replacement );
}
}

String Extensions that lets one to easily manipulate Newlines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment