Hello,
i have got two listboxs, there are listbox1 and listbox2
forex.
listbox1.items are = (teacher,school,pen,pencil,germany,asia,asia1,asia2,asia3)listbox2.items are =(asia,pen)
i have to search the listbox2 items in listbox1 and if listbox1 contains the words from listbox2. it must be deleted.
result might be load to listbox3
and the items would be (teacher,school,germany) of course...
and i have got one more questions. i got the list from a text box, but the list is over then 18mb and, i have to wait too much, is there any ways to resolve this waiting prblem...
Thanks
Search Array in a Array ?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

ShankeyRank #972 · 2.1K reputationPosted Aug 19, 2010, 2:52 AM EDT
Here is your code for aspx:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
vb.net code
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
For d As Integer = 0 To list2.Items.Count - 1
Dim f As Integer = 0
While f < list1.Items.Count
If list1.Items(f).Text.Contains(list2.Items(d).Text) Then
list1.Items.RemoveAt(f)
f = f - 1
End If
f = f + 1
End While
Next d
For g As Integer = 0 To list1.Items.Count - 1
list3.Items.Add(list1.Items(g))
Next g
End Sub
End Class
vijay172 reputationPosted Feb 24, 2011, 7:29 PM EST
For searching a items in array you dont need to use any loop for searching the items,instead of that you have to use this method to search item in array...http://vbdotnetaddict.blogspot.com/2011/02/search-items-in-array-string-without.html