首页 > 其他分享 >涉及到字符串中有多个数据需要替换使用StringBuffer

涉及到字符串中有多个数据需要替换使用StringBuffer

时间:2023-01-13 09:33:48浏览次数:42  
标签:personafterchange StringBuffer StringHelper hrids 字符串 updatePeopleTeam docExtref

String docExtrefobjfield11=StringHelper.null2String(docMap.get("extrefobjfield11"));//团队成员
StringBuilder updatePeopleTeam = new StringBuilder();
if (StringHelper.isNotEmpty(docExtrefobjfield11)){
String []hrids=docExtrefobjfield11.split(",");
for (int k=0;k<hrids.length;k++){
if (hrids[k].equals(personbeforechange)){
continue;
}
updatePeopleTeam.append(hrids[k]);
updatePeopleTeam.append(",");
}
if (StringHelper.isNotEmpty(personafterchange)){
updatePeopleTeam.append(personafterchange);
}

}else {
updatePeopleTeam.append(personafterchange);
}

标签:personafterchange,StringBuffer,StringHelper,hrids,字符串,updatePeopleTeam,docExtref
From: https://www.cnblogs.com/jk200/p/17048553.html

相关文章