function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
String a = '111,112,113,114 etc'; String[] lst = a.split(','); String result1; String result2; System.debug('lst.size()== '+lst.size()); for(Integer i = 0; i<lst.size() ; i++){ if(i < 3){ if(i == 0){ result1 = lst[i]; } if(i> 0 && i<3){ result1 += ','+lst[i]; } if( i== 2){ result2 = lst[i]; } }else{ if(i== 3){ result2 += ','+lst[i]; } } } system.debug('result1 '+result1); system.debug('result2 '+result2);
Please use below code:- if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
All Answers
Please use below code:- if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
can possible the if else is dynamic base on the length lst size every 3..?
The string result will also automatic increment
can this possible?