Extracts a sub array from an existing array.
arrayMid(array, start [, count])
→ returns array
array.mid(start [, count])
Lucee 4.5+ Extract elements from an array staring with element 5 and ending with the last element of the array.
vehicles = ['Mustang','Nova','Celica','Camry','Tacoma','Tundra','Ram','F-250'];
trucks = arrayMid(vehicles, 5);
writeOutput(arrayToList(trucks));
Expected Result: Tacoma,Tundra,Ram,F-250
Lucee 4.5+ Extract 4 elements from an array staring with element 3.
vehicles = ['Mustang','Nova','Celica','Camry','Tacoma','Tundra','Ram','F-250'];
toyotas = arrayMid(vehicles, 3, 4);
writeOutput(arrayToList(toyotas));
Expected Result: Celica,Camry,Tacoma,Tundra
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.