title: Character in each alternate index of S1 should be replaced with S2 using java
body: <p>For example i have a string s1 = "java" and alternate character of index s1 should be replaced with string s2 ="va". that is final result should be jvavva. I was able to do by using a specific letter. But I'm unable to do when i have a string such as "example" </p>
  
  <pre><code>    for(int i=0; i&lt;s1.length(); i++){
          ch = s1.charAt(i);
          replace = s1.replace("A", s2);
      }       
      System.out.println(replace);
  </code></pre>