Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String replaceCharacters(String in, String[][] replacement) {
        if (in == null || ("".equals(in)))
            return "";
        String retVal = in;
        for (int j = 0; j < replacement.length; j++) {
            retVal = retVal.replaceAll(replacement[j][0], replacement[j][1]);
        }
        return retVal;
    }
}