WANG 5 years ago
parent
commit
5cc75c35c5
1 changed files with 28 additions and 0 deletions
  1. 28 0
      src/main/java/cn/com/qmth/examcloud/commons/util/StringUtil.java

+ 28 - 0
src/main/java/cn/com/qmth/examcloud/commons/util/StringUtil.java

@@ -359,4 +359,32 @@ public class StringUtil {
 		return l;
 	}
 
+	/**
+	 * 字符串是否为"true"
+	 *
+	 * @author WANGWEI
+	 * @param s
+	 * @return
+	 */
+	public static boolean isTrue(String s) {
+		if (null == s) {
+			return false;
+		}
+		return s.equalsIgnoreCase("true");
+	}
+
+	/**
+	 * 字符串是否为"false"
+	 *
+	 * @author WANGWEI
+	 * @param s
+	 * @return
+	 */
+	public static boolean isFalse(String s) {
+		if (null == s) {
+			return false;
+		}
+		return s.equalsIgnoreCase("false");
+	}
+
 }