/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package de.nplusc.hhn;

/**
 *
 * @author LH
 */
public class ZipShift
{
    public static void main(String[] args)
    {
        String a = "TestABCDE";
        
        
        System.out.println(a+"\n"+zip2(a,shift(a)));
    }
    public static String zip2(String in1,String in2)
    {
        return //((in1.length()<2)&&(in2.length()<2))?in1+in2:zip(in1.substring(1),in2.substring(1));
                in1.length()<2?
                    in1+in2:
                    in2.length()<2?
                        in1.substring(0,1)+in2+in1.substring(1):
                        in1.substring(0,1)+in2.substring(0,1)+zip2(in1.substring(1),in2.substring(1));
                        
    }
    
    public static String shift(String in)
    {
        return in.length()<2?in:in.substring(1)+in.substring(0,1);  
    }
}
