- Home /
Removeat with Strin[]
Hello
Please i want to know how can i use arr.RemoveAt(1) with an array of string
var aRobotPart=new string[3]{"Arm","Leg","Head"}
and i want to add
aRbotoPart.RemoveAt(1)
how can i make this knowing that i haven't use aRobotPart= new Array["","",""]
thx
Comment
Answer by Berenger · Jan 27, 2012 at 08:06 PM
To remove an array member and shorten the array, either you do it yourself by finding the desired item, removing and copying what comes next, or you can use lists.
As for the not assigned array you want to remove from, that's not possible. Ever.
Answer by zakkar · Jan 27, 2012 at 09:29 PM
then for the list after i have made var aRobotPart=new List{"Arm","Leg","Head"} how can i point to the third élement and delete it