I would like to see if an array starts with the same elements as another array without having to write a bunch of for loops going through each element individually.
For example if I had the arrays below
Array1 = [1 2 3 4]
Array2 = [1 2 3 4 5 3 2 5 7]
Array3 = [1 2 3 5]
Then comparing Array1 with Array2 would return true. and comparing Array3 with Array2 would return false.
Is there any quick and easy way of doing this. I would not know the lengths of the arrays I would be comparing. The number of elements I want to compare equals the length of the shortest vector.
Thanks!