Click here to Skip to main content
16,016,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
How to use Hashset(T) to Search substring In a String On a huge database ...

I have one Textbox that contain long string with No space

And One Of (.MDB) database collection of string Over 90 thousand items...

while using "Instr" of Ms access Function It took lot of tym to search substring ...

I have Read About Hashset<t> Is it realy faster then database search ... if yes then how to use database with Hashset to search substring Fast ...

Thnnxss in advance ...
Posted

1 solution

A HashSet<string> is not meant to do searches on substrings.
A HashSet stores the hashcodes of its elements, and it provides a fast way to check wheter a specific element is already contained or not (fast because the search is done against hash codes, not values).
A List<string> could be more suitable.
 
Share this answer
 
Comments
Member 10521418 15-Jul-15 4:15am    
"list<string>" will it be faster to search substring
Member 10521418 15-Jul-15 4:20am    
can we reverse the hashset that store the long string and then use database to search in a hashset will it be fast

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900