Hi, I have got an array and I want to create an other array from that array by specifying start and end index. I receive start value and number of values require from a client. I workout values require by int endValue = valueRequire - startValue; then create an array, of "endValue" length; new Array[endValue]; then put two arrays in a loop and populate the newly created array by reading the original array. This is very very bad, it works for some numbers and fails for others. Can't we just pass in two numbers(start and end) for an array and it gives back a sub array.for example AnyType subArray = actualArray(1,5); Can anyone suggest a better way of doing this. Thanks Khurram.
Joined: Aug 08, 2002
I have found the answer, convert the array into a List and then use List.subList(startValue, endValue);