7. 4. 2012
How to create case insensitive TDictionary<>
Very simple:
uses System.Generics.Collections, System.Generics.Defaults;
var
Dictionary: TDictionary<string, TValue>;
begin
Dictionary := TDictionary<string, TValue>.Create(TIStringComparer.Ordinal); // ‹- this is the trick
try
.
.
.
finally
Dictionary.Free;
end;
end;
Indeed you can use TObjectDictionary<>. Tested in Delphi XE2.
Štítky: Delphi, Delphi programming, Generics
Odběr zpráv
Poslední články
- Das Masterpiece
- ⊃∪∩⪽ 2020
- Správné pořadí filmů Star Wars
- Seriál CSS Grid: 2× div vedle sebe
- Generic Reduce for Delphi
- Méně známé klávesové zkratky Delphi IDE
- London Grammar
- Plain text z HTML textu
- Smazání souborů staršínch než N dnů Windows dávkou
- Radiohead: OK Computer
Kategorie
- Windows (8)
- Delphi programming (13)
- SQL Server (3)
- Google (4)
- Internet (3)
- Aplikace (3)
- Vánoce (2)
- Vtipy (2)
Odkazy
- SQL Server versions
- Microsoft Knowledge Base
- Delphi programming