java 8 处理字符拼接有null问题

 this.mailingAddress = String.format("%s%s", Optional.ofNullable(districtName).orElse(""),
                Optional.ofNullable(mailingAddress).orElse(""));

 

posted @ 2022-10-31 15:33  八英里  阅读(86)  评论(0编辑  收藏  举报