In this way using Linq we can do this:
In VB.Net :
In VB.Net :
Dim myArray As String() = New String(2) {} myArray(0) = "Hello World" myArray(1) = "This is a sample code" myArray(2) = "Delete me" myArray = myArray.Where(Function(w) w <> myArray(2)).ToArray()
In C# :
string[] myArray = new string[3]; myArray[0] = "Hello World"; myArray[1] = "This is a sample code"; myArray[2] = "Delete me"; myArray = myArray.Where(w => w != myArray[2]).ToArray();
0 comments:
Post a Comment