Java Char Create toCharacter(String str, String charset)

Here you can find the source of toCharacter(String str, String charset)

Description

to Character

License

Apache License

Declaration

public static String toCharacter(String str, String charset) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static String toCharacter(String str, String charset) {
        if (str != null && !str.equals("")) {
            try {
                return new String(str.getBytes("ISO8859-1"), charset);
            } catch (Exception var3) {
                var3.printStackTrace();
                return "";
            }//w w w .ja v  a 2s  . co m
        } else {
            return "";
        }
    }

    public static boolean equals(String str1, String str2) {
        return str1 != null && !str1.equals("") && str2 != null && !str2.equals("") ? str1.equals(str2) : false;
    }
}

Related

  1. toCharacter(Object o)
  2. toCharacter(Object obj)
  3. toCharacter(Object object)
  4. toCharacter(Object value)
  5. toCharacter(String input, char defaultValue)
  6. toCharCode(String s)
  7. toCharListNumber(int value, String list)
  8. toChars(byte b, char[] result, int position)
  9. toChars(final int cp, final char[] buffer, final int offset)