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

📄 stringtool.java

📁 这是一个学校老师和学生的管理系统,程序比较简单,但是几乎所有功能都可以实现,如果想要用,只要再添加一些东西就可以了.
💻 JAVA
字号:
/**
 *******************************************************************************
 * StringTool.java
 *
 * (c) Copyright 2008 Hewlett-Packard Development Company, L.P.
 *
 *<Program Content>
 *  System Name : Students Management System
 *<Summarize>
 *  The file includes a class and  the main function of the class is to judge 
 *  whether a string is null or empty or made up by space characters.
 *<Update Record>
 *  2009-4-18    1.00    zhangliy
 *******************************************************************************
 */
package com.hp.eds.zhangliyuan.stuMan.util;

/**
 * The class main function is to judge whether a string is null or empty or made
 * up by space characters.
 * 
 * @author zhangliy
 * @version 1.0
 */
public class StringTool {
	/**
	 * judge whether a string is null or empty or made up by space characters.
	 * 
	 * @param string
	 *            -the string needs to be judged
	 * @return boolean(true:the string is null or empty or made up by space
	 *         characters;false:the string is not empty)
	 */
	public static boolean isStringEmpty(String string) {
		if (string == null || string.length() == 0) {
			// the string is null or its length is 0
			return true;
		}
		for (int i = 0; i < string.length(); i++) {
			if (string.charAt(i) == ' ') {
				// the character is space
				continue;
			} else {
				// the character is not space,return false
				return false;
			}
		}
		// the string is made up by space characters,return false
		return true;
	}

}

⌨️ 快捷键说明

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