java代码048

code048.java

package pack01;

import java.io.UnsupportedEncodingException;

//���������������������ַ�ʱת�봦�����
public class code048
{
    public code048()
    {

    }

    /**
     * ���ַ�������ת�봦��
     * @param str Ҫת����ַ���
     * @return �������ַ���
     */
    public String toString(String str)
    {
        String text = "";
        //�ַ�����Ϊnull����Ϊ�ո�
        if (str != null && !"".equals(str))
        {
            try
            {
                text = new String(str.getBytes("iso-8859-1"),"utf-8");

            } catch (UnsupportedEncodingException e)
            {
                e.printStackTrace();
            }
        }
        //ת����
        return text;
    }
}

评论

h
hw_7864

⭐️ Admin快速开发: https://show.cool-admin.com/

赞 0
h
hw_7864

⭐️ 官方文档: https://cool-js.com

赞 0
h
hw_7864

⭐️ chatgpt在线体验: https://cool-js.com/ai/chat-vip/index.html?r=helloworld

赞 0