Java String Translate translate(String str, String string_in, String string_out)

Here you can find the source of translate(String str, String string_in, String string_out)

Description

translate

License

Open Source License

Declaration

private static final String translate(String str, String string_in, String string_out) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {

    private static final String translate(String str, String string_in, String string_out) {

        String s = str.toUpperCase();
        char[] outc = new char[s.length()];
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            int j = string_in.indexOf(c);
            outc[i] = string_out.charAt(j);

        }/*  w  w w.  ja  v a2 s  .co  m*/
        String outs = new String(outc);

        return outs;
    }
}

Related

  1. translate(String sequence, String match, String replacement)
  2. translate(String source)
  3. translate(String str, String searchChars, String replaceChars)
  4. translate(String str, String searchChars, String replaceChars)
  5. translate(String str, String searchChars, String[] replaceStrings)
  6. translate(String[] ids, String alias)
  7. translate(StringBuffer sb, CharSequence from, CharSequence to)