scottobear: (Default)
[personal profile] scottobear

Pretty self explanatory:

/**
* mergeListToArray
* When provided a list and an array, we convert the list to an array and merge them.
* @param {Array} a Array to merge list to {required}
* @param {String} l List to merge with array {required}
* @param {String} delim Delimiters to use default = ','
* @return {Array}
*/
public Array function mergeListToArray(required array a,required string l,required string delim=','){
var tmpArr = ListToArray(trim(arguments.l),delim);
var newArr = arguments.a;
if(IsArray(newArr) && IsArray(tmpArr)){
// loop over current array and append to new array
for(i=1; i LTE ArrayLen(tmpArr); i=(i+1)){
ArrayAppend(newArr,tmpArr[i]);
}//end loop
}//end isarray
return newArr;
};

Originally published at The Scotto Grotto. You can comment here or there.

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

scottobear: (Default)
scott von berg

April 2017

S M T W T F S
       1
2 345678
9 10 11 12 13 14 15
16 1718 19 20 21 22
23 2425 26 2728 29
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 27th, 2026 04:02 am
Powered by Dreamwidth Studios