title: Differentiating between different values with a Line.Contains()
body: <p>Something I was curious about, I'm coding a utility for a old game that I play and this allows for custom NPC's. Long story short, I'm coding a reader for these custom NPC files. I've gotten most of the reading down with a line.contains() method (all code will be shown later) but there's a problem. The file can contain either just "height" or "gfxheight" which both do different things. Using line.contains("width") will make it output both width and gfxwidth twice. I don't really know any good way to explain it so here's the file:</p>
  
  <pre><code>width=32
  height=32
  gfxwidth=64
  gfxheight=32
  nofireball=1
  noiceball=1
  noyoshi=1
  grabside=0
  </code></pre>
  
  <p>The Console output when I read it in and do what I need to split the lines and such:</p>
  
  <p><img src="https://i.stack.imgur.com/4s5Yz.png" alt="enter image description here"></p>
  
  <p>And here's the code I use for height and gfxheight (of course there are others but these are the only problems I have when reading):</p>
  
  <pre><code>if (line.Contains("height"))
                      {
                              var split = line.Split(new char[] { '=' }, 2);
                              decimal dc;
                              //var val = int.Parse(split.ToString());
                              Console.WriteLine(split[0].ToString() + " is equal to " + split[1].ToString());
                              npcHeight.Value = Decimal.Parse(split[1].ToString());
                              npcHeight.Enabled = true;
                              npcHCb.Checked = true;
                      }
  
                      if (line.Contains("gfxheight"))
                      {
                          var split = line.Split(new char[] { '=' }, 2);
                          //var val = int.Parse(split.ToString());
                          Console.WriteLine(split[0].ToString() + " is equal to " + split[1].ToString());
                      }
  </code></pre>
  
  <p>Of course there's also the code for width and gfxwidth and the other various codes but I'm not going to bother posting those because I can apply what I get for the height to those.
  So what would I have to do to differentiate between them? Suggestions?</p>
  
  <p>Thanks in advanced,</p>
  
  <p>Mike</p>