/**
* 判断字符串是否是整数
*/
public static boolean isinteger(string value) {
try {
integer.parseint(value);
return true;
} catch (numberformatexception e) {
return false;
}
}
/**
* 判断字符串是否是浮点数
*/
public static boolean isdouble(string value) {
try {
double.parsedouble(value);
if (value.contains("."))
return true;
return false;
} catch (numberformatexception e) {
return false;
}
}
/**
* 判断字符串是否是数字
*/
public static boolean isnumber(string value) {
return isinteger(value) || isdouble(value);
* 判断字符串是否是整数
*/
public static boolean isinteger(string value) {
try {
integer.parseint(value);
return true;
} catch (numberformatexception e) {
return false;
}
}
/**
* 判断字符串是否是浮点数
*/
public static boolean isdouble(string value) {
try {
double.parsedouble(value);
if (value.contains("."))
return true;
return false;
} catch (numberformatexception e) {
return false;
}
}
/**
* 判断字符串是否是数字
*/
public static boolean isnumber(string value) {
return isinteger(value) || isdouble(value);
}
linux 下log4j.xml 加入日志文件位置 log4j.appender.A1.File=${catalina.home}/logs/kd/kd.log. 首先在tomcat下建立kd文件夹,再建立kd.log文件。OK