title: c# How to get substring with more than one of the same characters
body: <p>I have the following string, with the variable of <code>s</code>:</p>
  
  <p><code>Room: 501, User: John, Model: XPR500   Serial: JK0192, Condition: Good</code></p>
  
  <p>I want to extract the Model, <code>XPR500</code> and the Serial, <code>JK0192</code></p>
  
  <p>I was able to get the model with the following code:</p>
  
  <pre><code>                int pFrom = s.IndexOf("Model: ") + "Model: ".Length;
                  int pTo = s.LastIndexOf(" Serial:");
  
                  String model = s.Substring(pFrom, pTo - pFrom);
  </code></pre>
  
  <p>But, I am having difficulty getting the serial value. I have attempted this code:</p>
  
  <pre><code>                int pFromt = s.IndexOf("Serial: ") + "Serial: ".Length;
                  int pToT = s.LastIndexOf(", ");
  
                  string serial = s.Substring(pFromt, pToT - pFromt);
  </code></pre>
  
  <p>but it returns</p>
  
  <p><code>JK0192,Condition: Good</code></p>
  
  <p>I am having trouble getting it to get everything from Serial: and the next comma.</p>
  
  <p>Can anyone see where I am going wrong?</p>