title: Visual Studio search/replace with local function name
body: <p>I’m looking for a way to search through my cs file and replace some text with the name of the local function.</p>
  
  <p>e.g. </p>
  
  <pre><code>private void SampleFunction()
  {
    string foo = “bar“;
  }
  </code></pre>
  
  <p>Task: search for each „bar“ and replace with function name.</p>
  
  <p>Result would be:</p>
  
  <pre><code>private void SampleFunction()
  {
    string foo = “SampleFunction“;
  }
  </code></pre>
  
  <p>I’m aware I could use reflection during runtime, but the functions name are unreadable due to obfuscation, that’s why I like to put the function name into a string. Automated for 600 functions I use.</p>
  
  <p>Is there any (easy) way to archive this?
  Thank you for your support.</p>
  
  <p>Btw. I googled and searched through stack Overflow but did not found any helpful post for this particular case.</p>