title: Replace multiple characters in string in one line of code in VB.NET
body: <p>Using VB.NET I'd like to be able to replace a range of characters in a string in a single line of code.</p>
  
  <p>I.e., something like:</p>
  
  <pre><code>Dim charsToReplace as string = "acegi"
  Dim stringToBeReplaced as string = "abcdefghijklmnop"
  
  charsToReplace.ToArray().ForEach(Function (c) stringTobeReplaced = stringTobeReplaced.Replace(c, ""))
  </code></pre>
  
  <p>However, this doesn't work.</p>
  
  <p>The following does work, however I don't want the string to be a class level variable:</p>
  
  <pre><code> Sub Main()
      Dim toReplace As String = "acegikmoq"
  
      Console.WriteLine(mainString)
      Dim chars As List(Of Char) = toReplace.ToList()
      chars.ForEach(AddressOf replaceVal)
  
      Console.WriteLine(mainString)
      Console.ReadLine()
  End Sub
  
  Dim mainString As String = "this is my string that has values in it that I am going to quickly replace all of..."
  
  Sub replaceVal(ByVal c As Char)
      mainString = mainString.Replace(c, "")
  End Sub
  </code></pre>
  
  <p>Can this be done?</p>