Re: Best way to check is a string is in a list?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Yep, that should do it,

Thanks,

Gerrit Beuze
ModelMaker Tools

> The hashtable does support a case insensitive comparer. There is an
> overload of the constructor which you can pass a new instance of a
> CaseInsensitiveComparer and a CaseInsensitiveHashcodeProvider, and this will
> give you what you want for the case-insensitive keys.
>
> Hope this helps.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> "Gerrit Beuze" <gerrit[at]modelmaker[dot]demon[dot]nl> wrote in message
> news:eiUiWCcdFHA.2984@xxxxxxxxxxxxxxxxxxxxxxx
> > Hi all,
> >
> > Using C# 1.1:
> > I need a fast way of determining whether a string is in a list of approx
> > 150 keyword like strings.
> > in two versions: one case-sensitive, the other one case-insenstive.
> >
> > I thought of loading the keywords in a Hastable as Keys with null values,
> > and then use Hastable.ContainsKey(string)
> > but Hashtable does not seem to support case-insentive keys.
> >
> > Linear search using a StringCollection is too slow for what I'm looking
> > for.
> >
> > Any suggestions on the data structure to use?
> > Does the 1.1 framework come with sorted (case insentive) stringlists ?
> >
> > Thanks in advance,
> >
> > Gerrit Beuze
> > ModelMaker Tools
> >
> >
>
>


.



Relevant Pages

  • Re: ModelMaker 8 based C# Eco Modeler released
    ... There will be a free update somewhere around next week that included ... D2005 support. ... Gerrit Beuze ... ModelMaker Tools ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Any Delphi plug-in can do this ? (add delete function to code explorer)
    ... Delete, Cut, Copy, paste, Rename, Edit etc. Drag drop support and much more. ... All available in ModelMaker Code Explorer ... Gerrit Beuze ... ModelMaker Tools ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: UML toolkit
    ... a native Delphi Pascal modeler: ... with Delphi 5 - Delphi 2007 support. ... Gerrit Beuze ... ModelMaker Tools ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Compare 2 PAS files
    ... Gerrit Beuze ... ModelMaker Tools ... We use Visual SourceSafe (but ... > others may use alternative products), ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Analysis tools
    ... does MM include the functions in MMX? ... Gerrit Beuze ... >> First refactor the code in to clean methods and properties in the GUI form, ... >> ModelMaker Tools ...
    (borland.public.delphi.thirdpartytools.general)