package com.fr.function;
import com.fr.script.AbstractFunction;
import com.fr.stable.exception.FormulaException;
import java.util.Arrays;
public class getDeptName1 extends AbstractFunction {
@Override
public Object run(Object[] objects) throws FormulaException {
String str = (String) objects[0];
String [] arr = str.split("=");
String name = "";
for (int i = 0; i <= arr.length - 1; i++) {
String a = arr[i].split(",")[0];
//System.out.println(a);
if (i >= 1) {
a = "','" + a;
}
name = name + a;
}
return name;
}
}
这是我写的一个拆分的自定义函数,你看看区别