title: Remove CRLF from string C#
body: <p>I'm trying to convert  this VBA fonction that remove CRLF from string to a C# function that must do the same result </p>
  
  <pre class="lang-vb prettyprint-override"><code>Private Function RemoveCRLFFromString(ByVal pString As Variant) As String
  Dim i As Integer
  Dim c As String * 1
  
   If IsNull(pString) Then
      RemoveCRLFFromString = ""
   Else
      For i = 1 To Len(pString)
          c = Mid$(pString, i, 1)
          If Asc(c) &lt;&gt; 10 And _
             Asc(c) &lt;&gt; 13 Then
             RemoveCRLFFromString = RemoveCRLFFromString &amp; c
          End If
      Next i
   End If
  
  
   RemoveCRLFFromString = Left$(RemoveCRLFFromString, 9)
  
  End Function
  </code></pre>
  
  <p>So far I have come up with:</p>
  
  <pre class="lang-csharp prettyprint-override"><code>public static string RemoveCRLFFromString(string pString )
  {
      if(String.IsNullOrEmpty(pString))
      {
          return pString ;
      }
      string lineSep = ((char) 0x2028).ToString();
      string paragraphSep = ((char)0x2029).ToString();
  
      return pString.Replace("\r\n", string.Empty).Replace("\n", string.Empty).Replace("\r", string.Empty).Replace(lineSep, string.Empty).Replace(paragraphSep, string.Empty);
  }
  </code></pre>
  
  <p>But it's not achieving the same result, can someone help me adjust my C# function to match the same result as the VBA version?</p>