18 Replies
i did this drawing as an example since im not good with words
basically i gotta remove stuff from the array
so like with the var delete it basically removes values inside that array
in the end i should still have 7 places available but inside those 5 i deleted there shouldnt be anything left
You can use Range operator
Toshiya Joshima#3472
REPL Result: Success
Result: int
Compile: 458.835ms | Execution: 56.721ms | React with ❌ to remove this embed.
im confused how did result 1 come up
and what does this mean
^ means from End
It starts to count from End
From end 5th element
oh i see
which is 1
so the other numbers are gone right
but not like
the spaces
It's not returnign the value itself
It returns index
oh
arrays are immutable. You can't delete elements from them without making new arrays.
oh
alright so when i do an array that has like 10 different values, its size will always be 10 no matter what
?
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.
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.alright
ty
You can close this thread with /close
i gotta do something first
when i dont need it ill close it
Closed!