take input one field as "field" and one output as "result" udf type is all values of a context.
int len = field[0].length();
String str = field[0];
int number = (int)Math.ceil(len/5);
for(int i=0; i<number; i++)
{
if(i!=number-1)
result.addValue(str.substring(i*5,(i+1)5));
else
result.addValue(str.substring(i*5,str.length());
}
ex
ABCDE
FGHIJ
KLMNO
P 15-16
len 16
num = 4
ABCDEFGHIJKLMNOP
map the udf to target node featureID