Let’s consider an array & it’s values are
int[] array = {0, 0, 1, -1, -1,-1, 1, 1, 1};
I want to remove first three values of the array…?
& my result should be array = {-1, -1, -1, 1, 1, 1}
Thanks in advance….!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t remove items from an array – it has a fixed size.
However, you could create a new array with only the values you want. With LINQ that’s easy:
If you want to modify an existing collection to add or remove values, you want
List<T>instead and itsRemoveRangemethod: