title: C# Split function problem
body: <pre><code>string value = "L3 ABCD L4 3501% L5 20%,L3 EFGH L4 17260% L5 20%,L3 IJKL L4 2051% L5 20%,L3 MNOP L4 2621% L5 20%,L3 QRST L4 45325% L5 20% L2 40%";
  </code></pre>
  
  <p>I am trying</p>
  
  <pre><code>string[] splitvalues = value.Split();
  </code></pre>
  
  <p>then using a switch to find out whether it is L2, L3, L4, L5</p>
  
  <p>But value at L5 is fetching "20%,L3"</p>
  
  <hr>
  
  <p>The code is:</p>
  
  <pre><code>string[] splitvalues = value.Split();
  
  for (int i = 0; i &lt; splitvalues .Length; i = i + 2)
  {
      String id = splitvalues [i];
      switch (id)
      {
          case "L3":
              Name = splitvalues [i + 1];
              break;
          case "L4":
              Number1.FromString(splitvalues [i + 1]);
              break;
          case "L5":
              Number2.FromString(splitvalues [i + 1]);
              break;
          case "L2":
              Number3.FromString(splitvalues [i + 1]);
              break;
      }
  }
  </code></pre>