Split method is used to split value of a Name or Number using a decimal or comma so that we can separate them and use in fields in report or in form
public static void main (Args args)
{
str _Value,beforeDec,afterDec;
int x;
str str1='Jake,Grey';
Names names;
List strlist=new List(Types::String);
ListIterator iterator;
strlist=strSplit(str1,',');
iterator = new ListIterator(strlist);
while(iterator.more())
{
x= x+1;
if(x==1)
{
beforeDec =iterator.value();
}
if(x==2)
{
afterDec = iterator.value();
}
iterator.next();
}
names.FirstName = beforeDec;
names.LastName = afterDec;
names.insert();
info('Job runned succesfully');
}
Comments
Post a Comment