⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 str.java

📁 这是一个用JSP和SQL Server实现的一个网络办公自动化系统.里面包括所有需要用到的源代码.
💻 JAVA
字号:
/*
 * Created on 2004-9-18
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package oa.sys;
/**
 ****************************************************
 *类名称:	Str<br>
 *类功能:	字符串转换操作<br>
 *创建:	白伟明	2004年9月23日<br>
 ****************************************************
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
public class Str {
	/**
	 * 
	 */
	public Str() {
		super();
	}

	/***************************************************
	*函数名称:chStr()<br>
	*函数功能:返回中文字符串<br>
	*返回值:  String<br>
	*参数说明:str<br>
	*最后修改:白伟明
	*		   2004年8月17日
	****************************************************/
	public String chStr(String str){
		if(str==null){
			str="";
		}else{
			try{
				str=(new String(str.getBytes("iso-8859-1"),"GB2312")).trim();
			}catch(Exception e){
				System.out.println("chStr");
				System.out.println(e.getMessage());
			}
		}
		return str;
	}
	/***************************************************
	*函数名称:inStr()<br>
	*函数功能:做编码一次转换,入库时防止sql攻击<br>
	*返回值:  String<br>
	*参数说明:str<br>
	*最后修改:白伟明
	*		   2004年8月17日
	****************************************************/
	public String inStr(String str){
		if(str==null){
			str="";
		}else{
			try{
				str=str.replace('\'',(char)1).trim();
			}catch(Exception e){
				System.out.println("inStr");
				System.out.println(e.getMessage());
			}
		}
		return str;
	}

	/***************************************************
	*函数名称:outStr()<br>
	*函数功能:做编码二次转换,出库时防止Exception<br>
	*返回值:  String
	*		   返回中文字符串<br>
	*参数说明:str<br>
	*最后修改:白伟明
	*		   2004年8月17日
	****************************************************/
	public String outStr(String str){
		if(str==null){
			str="";
		}else{
			try{
				str=str.replace((char)1,'\'').trim();
			}catch(Exception e){
				System.out.println("outStr");
				System.out.println(e.getMessage());
			}
		}
		return str;
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -