public static String patttobin(String code, String zero, String one) {
        if(!zero.equals("") || !one.equals("")) {
            char[] zeros = zero.toCharArray();
            char[] ones = one.toCharArray();
            char[] codeline = code.toCharArray();
            String result = "";
            for(int i = 0; i < codeline.length; i++) {
                boolean done = false;
                for(char zero2 : zeros) {
                    if(codeline[i] == zero2) {
                        codeline[i] = '0';
                        done = true;
                        break;
                    }
                }
                if(!done) {
                    for(char one2 : ones) {
                        if(codeline[i] == one2) {
                            codeline[i] = '1';
                            break;
                        }
                    }
                }
            }
            for(char element : codeline) {
                result += element;
            }
            return result;
        }
        return "";
    }