org.apache.commons.lang.StringUtils
作为jdk中lang包的补充
检查CharSequence是否为空,null或者空格
CharSequence (CharBuffer, Segment, String, StringBuffer, StringBuilder)
- isBlank(CharSequence) 可以检查空,null和空格
- isEmpty(CharSequence) 只能检查空和null\
- 还有isNotBlank(cs)和isNotEmpt(cs)
字符串截取
Substring/Left/Right/Mid - null-safe substring extractions
字符串补全
LeftPad/RightPad/Center/Repeat - pads a String
import org.apache.commons.lang3.StringUtils;
// 右边补0至6位
StringUtils.rightPad("123", 6, "0");
// 123000