Answer the question
In order to leave comments, you need to log in
How to remove some elements from an array?
Good evening. I struggle with what seems to be a trivial thing, but it turns out to be a vegetable garden.
I want to slice the array by writing to the new one, but still extract them from the main one.
There is an array arr1 of 20 entries. We need to get the first 15 and put them in a new array arr2.
arr1 should be left with arr1 = arr1 - arr2.
Well, or in the foreach loop, print the first 15 from arr1 and jump out of the loop with the remainder of 5 elements in it.
I can't find an easy solution. Help, plz.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question