✅ array

GGododo11/23/2022
how can i do this?
Image
GGododo11/23/2022
i did this drawing as an example since im not good with words
GGododo11/23/2022
basically i gotta remove stuff from the array
GGododo11/23/2022
so like with the var delete it basically removes values inside that array
GGododo11/23/2022
in the end i should still have 7 places available but inside those 5 i deleted there shouldnt be anything left
SSamarichitane11/23/2022
You can use Range operator
GGododo11/23/2022
im confused how did result 1 come up
GGododo11/23/2022
and what does this mean
Image
SSamarichitane11/23/2022
^ means from End
SSamarichitane11/23/2022
It starts to count from End
SSamarichitane11/23/2022
From end 5th element
GGododo11/23/2022
oh i see
SSamarichitane11/23/2022
which is 1
GGododo11/23/2022
so the other numbers are gone right
GGododo11/23/2022
but not like
GGododo11/23/2022
the spaces
SSamarichitane11/23/2022
It's not returnign the value itself
SSamarichitane11/23/2022
It returns index
GGododo11/23/2022
oh
Mmtreit11/23/2022
arrays are immutable. You can't delete elements from them without making new arrays.
GGododo11/23/2022
oh
GGododo11/23/2022
alright so when i do an array that has like 10 different values, its size will always be 10 no matter what
GGododo11/23/2022
?
Mmtreit11/23/2022
You can use Array.Resize to change the size of an existing array. That method will internally make a new array with the desired size and copy the data from the old array into it.
Mmtreit11/23/2022
Generally, however, if you want an array-like instance that you can grow and shrink, you should use a List<T> and not an array.
GGododo11/23/2022
alright
GGododo11/23/2022
ty
SSamarichitane11/23/2022
You can close this thread with /close
GGododo11/23/2022
i gotta do something first
GGododo11/23/2022
when i dont need it ill close it
AAccord11/23/2022
Closed!