Java Char Convert To convertChars(String orig_name, String chars, char toChar)

Here you can find the source of convertChars(String orig_name, String chars, char toChar)

Description

convert Chars

License

Open Source License

Declaration

public static String convertChars(String orig_name, String chars, char toChar) 

Method Source Code

//package com.java2s;

public class Main {
    public static String convertChars(String orig_name, String chars, char toChar) {
        StringBuffer tmp = new StringBuffer(orig_name);
        int i;//from  w  w w . j  a  v  a  2  s.co  m
        for (i = 0; i < tmp.length(); i++) {
            if (chars.indexOf(tmp.charAt(i)) != -1) {
                tmp.setCharAt(i, toChar);
            }
        }
        return new String(tmp);
    }
}

Related

  1. convertCharacterEntity(String value)
  2. convertCharacterOffsetToCodePointOffset(String inputStr, int charOffset)
  3. convertCharacters(String fileName)
  4. convertCharArray(char[] arr)
  5. convertCharArrayToIntArray(char[] chars)
  6. convertCharSet(String str, String desCharset)
  7. convertCharsToUnicodeChars(final String s, final boolean toLowerCase)
  8. convertCharToBoolean(final char value)
  9. convertCharToCharacterArray(final Object originalArray)