Java常用API笔记

1、比较忽略大小写:equalsIgnoreCase。

     使用示例:

String xRequestedWith = request.getHeader("X-Requested-With");//判断是否为异步请求
if("XMLHttpRequest".equalsIgnoreCase(xRequestedWith)){
                rednerView = view;//异步请求
}else{
    other code ……
}

2、SimpleDateFormat 

    使用示例:

// 设置日期格式
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
// 返回格式化后的字符串
String currentTime=df.format(new Date());






你可能感兴趣的:(Java常用API笔记)