import org.apache.commons.lang3.ArrayUtils;
/**
*
* @ClassName: RemoveSingleChartUtil
* @Description: TODO(移除单个字符id工具类)
* @author 学渣要逆袭
*
*/
public class RemoveSingleChartUtil {
// 匹配ID并且删除
public static String[] resultArray(String[] array, String compareId) {
if (array.length == 1) {
if (array[0].equals(compareId)) {
array = (String[]) ArrayUtils.remove(array, 0);
}
} else {
for (int i = 0; i < array.length;) {
if (array[i].equals(compareId)) {
if (array.length >= 1) {
array = (String[]) ArrayUtils.remove(array, i);
}
i = 0;
} else {
++i;
}
}
}
return array;
}
}