Skip to content
Advertisement

how to search in List which contains tuples?

I am having a list which having tuple object and I need to search the list for all tuples which contain the string typed in search box. can anyone please help me into this?

I created one search box which having binding function. I can get the text from search box. but for the same text I need to find objects form the list I need to append searched item in new list. so that I can update them in treeview.

JavaScript

Advertisement

Answer

but for the same text I need to find objects form the list

There are many ways to search through a string (i.e. how will you handle spaces in words? If someone types “Transducer Lower” would you want the tuple in index 2 to be a result?

But to access what I think is what you’re looking for, you would index into the tuple: item[0]

So something like this:

JavaScript

You can ignore case by, say, comparing the uppercase versions of typed and item[0]:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement