Liam

mail@pastecode.io avatar
unknown
java
2 years ago
573 B
6
Indexable
Never
public String add_toZahl(String zahl){
        char ch[]=zahl.toCharArray();
        String rev="";
        for(int i=ch.length-1;i>=0;i--){
            rev+=ch[i];
        }
        char rc[]=rev.toCharArray();
        String output = "";
        for(int i=0;i<rc.length;i++){
            output+=rc[i];
                if(i%3==2){
                    output+="_";
            }
        }
        char fc[]=output.toCharArray();
        String FinalStr = "";
        for(int i= fc.length-1;i>=0;i--){
            FinalStr += fc[i];
        }
        return FinalStr;
    }