How do I delete an element from an array variable (not a data table)

variable

#1

Cant find any way to delete an element from an array variable.


#2

arrTest= arrTest.Except(New String() {"Element to Remove"}).ToArray()

arrTest= arrTest.Except(New Integer() {1111}).ToArray()

or

Convert array to list, remove the elements and convert back to array


#3

Would you please show an example of how to convert array to list and remove a element? I’m getting error when using MyList.RemoveAt(0), I want to remove first element of the list.


#4

image

image


#5

Hi vvaidya,

How to remove multiple empty or null elements from a array.


#6

try this way

arr = arr.Where(Function(x) Not String.IsNullOrEmpty(x)).ToArray


#7

Hi @vvaidya

Thank you for the help.

Regards,
Hari