判断不为空再拼接 Object user = mapgetuser; Object title = mapgettitle; Object time = mapgettime; Object data = mapgetdata; Object version = mapgetversion; StringBuild
String result = "";
if (user != null) { stringBuilder.append(user.toString()); }
if (title != null) { stringBuilder.append(title.toString()); }
if (time != null) { stringBuilder.append(time.toString()); }
if (data != null) { stringBuilder.append(data.toString()); }
if (version != null) { stringBuilder.append(version.toString()); }
result = stringBuilder.toString();
原文地址: https://www.cveoy.top/t/topic/i9zX 著作权归作者所有。请勿转载和采集!