title: What is a more elegant way to parse this string?
body: <p>I have a task where i need to parse C# scripts and look for a certain method attribute and extract parts from it, and i wonder if there is a more elegant way than how i do it:</p>
  
  <p><code>[Info("Title", "Author", "5.2.5", ResourceId = 819)]</code></p>
  
  <p>Here is what i do:</p>
  
  <pre><code>// foreach line in script
  if (line.Contains("[Info(") &amp;&amp; line.Contains("ResourceId"))
  {
      var _attributes = line
          .Replace(" ", "")
          .Replace("\"", "")
          .Replace("[Info(", "")
          .Replace(")]", "")
          .Replace("ResourceId=", "")
          .Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
          // Do stuff with _attributes[0] _attributes[1] etc..
          break;
  }
  </code></pre>