title: C# String.Replace() & Regex.Replace() not working at my end
body: <p>I am trying to replace a string with some other string but nothing is working. i tried <strong>Regex.Replace() &amp; String.Replace()</strong> but no luck.</p>
  <p>See this code example</p>
  <pre><code>string maindata = &quot;Operational Metrics~Domestic Subscribers Disney+~2015 FY~9999&quot;;
  string data = &quot;Operational Metrics~Domestic Subscribers Disney+~2015 FY~9999&quot;;
  
                   //data = Regex.Escape(data);
          
                   string strformula = Regex.Replace(maindata, &quot;\&quot;&quot; + data.Replace(&quot;(&quot;, &quot;\\(&quot;).Replace(&quot;)&quot;, &quot;\\)&quot;).Replace(&quot;$&quot;, &quot;\\$&quot;) + &quot;\&quot;&quot;, &quot;W51&quot;,RegexOptions.IgnoreCase);
                   strformula = maindata.Replace(&quot;\&quot;&quot; + data.Replace(&quot;(&quot;, &quot;\\(&quot;).Replace(&quot;)&quot;, &quot;\\)&quot;).Replace(&quot;$&quot;, &quot;\\$&quot;) + &quot;\&quot;&quot;, &quot;W51&quot;);
  </code></pre>
  <p><strong>Regex.Escape(data); also does not work.</strong></p>
  <p>I really do not understand the reason behind why this replace is getting fail ? please guide me what is lacking there ?</p>
  <p>Thanks</p>
  <h2>EDIT</h2>
  <pre><code>string maindata = &quot;Operational Metrics~Domestic Subscribers Disney+~2015 FY~9999&quot;;
  string data =     &quot;Operational Metrics~Domestic Subscribers Disney+~2015 FY~9999&quot;;
  string strformula = Regex.Replace(maindata, data , &quot;W51&quot;,RegexOptions.None);
  </code></pre>
  <p>I simplify the code now see <strong>Regex.Replace</strong> not working.</p>