导包:import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
if (ObjectUtils.isNotNull(vo.getName())) {
boolean isTrue = true;
String condition = vo.getName().replaceAll("\\s+", " ");
for (int i = 0; i < condition.length(); i++) {
char chr = condition.charAt(i);
if ((chr < 48 || chr > 57) && chr != ' ') {
isTrue = false;
break;
}
}
if (isTrue) {
if (condition.charAt(0) == ' ') {
condition = condition.replaceFirst(" ", "");
}
condition = condition.replaceFirst(" ", "/");
condition = condition.replaceFirst(" ", "R");
}
vo.setName(condition);
}