title: Replacing unknown text between " " with #
body: <p>I currently have a large text file and I am trying to replace unknown text between anything inside "" with #. I've tried to use:</p>
  
  <pre><code> string text = File.ReadAllText(@"c:\Users\Zero\Documents\test.txt");
      string replacement = "#";
  
  
          int start = text.IndexOf('"') + 1;
         text = text.Replace(text.Substring(start, text.LastIndexOf('"') - start), replacement);
  
  
      File.WriteAllText(@"c:\Users\Zero\Documents\test.txt", text);
  </code></pre>
  
  <p>Currently it's replacing all text in the file with one line. in other words, it's turning:</p>
  
  <blockquote>
    <p>Hi how are you "test"</p>
    
    <p>This is a test "123" test</p>
    
    <p>"test" "test"</p>
  </blockquote>
  
  <p>into</p>
  
  <blockquote>
    <p>"#"</p>
  </blockquote>
  
  <p>I need it to do this</p>
  
  <blockquote>
    <p>Hi how are you "#"</p>
    
    <p>This is a test "#" test</p>
    
    <p>"#" "#"</p>
  </blockquote>