title: How to replace the text between two characters in c#
body: <p>I am bit confused writing the regex for finding the Text between the two delimiters <strong>{ }</strong> and replace the text with another text in c#,how to replace?</p>
  
  <p>I tried this.</p>
  
  <pre><code>        StreamReader sr = new StreamReader(@"C:abc.txt");
          string line;
          line = sr.ReadLine();
  
          while (line != null)
          {
  
              if (line.StartsWith("&lt;"))
              {
                  if (line.IndexOf('{') == 29)
                  {
                      string s = line;
                      int start = s.IndexOf("{");
                      int end = s.IndexOf("}");
                      string result = s.Substring(start+1, end - start - 1);
  
                  }
              }
              //write the lie to console window
              Console.Write Line(line);
              //Read the next line
              line = sr.ReadLine();
          }
          //close the file
          sr.Close();
          Console.ReadLine();
  </code></pre>
  
  <p>I want replace the found text(result) with another text.</p>