随笔小结

mysql  判定某一字段是否为null(不是空串)

select * from   表名  where id  is  not  null;

select *  from  表名 where  id  is   null  ;

split 分割 字符串(分隔符如:* ^ : | , .) 及注意点

在进行字符串分割时特殊字符 需要加上“\”   进行转义   如进行“|”进行分割时,需要这样操作   String.split("\|") ,否则无法分割成功。

java小技巧:用字符串构建日期Date对象

String DateStr = "2010-12-31-23-59-59";
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-kk-mm-ss");
Date DateObj = dateFormat.parse(endDateStr);

其中  dateFormat 的格式可以灵活地决定你的时间格式   如   时间字符串为20180808时   可设定格式为      yyyymmdd   则可动态生成相应的date时间。

原文地址:https://www.cnblogs.com/Cy66666666/p/9457311.html