title: Using foreach() in a string using android
body: <p>I am trying to use <code>foreach()</code> in Android:</p>
  
  <p>I have a String <code>String str1= "1E25E453e5dU543K24L"</code> and I am trying to put "-" after every four digits like a product key. </p>
  
  <p>I tried in C# it works for me. </p>
  
  <pre><code>foreach (char cMAC in str1){
          i++;
          if (i == 4 || i == 8 || i == 12 || i == 16)
               txtRegisterKey.Text += cMAC.ToString() + " - ";
          else
               txtRegisterKey.Text += cMAC.ToString();
  }
  </code></pre>
  
  <p>I want to do same thing in android, Do I get any Ideas. Thank You in advance</p>