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;
}
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册⭐️ Admin快速开发: https://show.cool-admin.com/
赞 0⭐️ 官方文档: https://cool-js.com
赞 0⭐️ chatgpt在线体验: https://cool-js.com/ai/chat-vip/index.html?r=helloworld
赞 0