字符串
2018-05-31 本文已影响0人
bigfish1129
-
拼装特定单据号,年月日
LocalDateTime lat = LocalDateTime.now();
int year = lat.getYear();
int monthValue = lat.getMonthValue();
int dayOfMonth = lat.getDayOfMonth();
bill.setOrderId("ABC" + year + Strings.padStart(String.valueOf(monthValue), 2, '0') + Strings.padStart(String.valueOf(dayOfMonth), 2, '0') + Strings.padStart(index, 5, '0')); -
空白校验
StringUtils.isBlank(ds.getId()) ? 0L : Long.parseLong(ds.getId()) -
url拼接
DTO.setUrl(this.getUrlPrefix().concat(m.getPicUrl())); -
字符串拼接
Joiner.on("_").join("ab", id, name) -
删除特定字符
String tempOrgName = cityName.replace("市", "").trim();