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
- Singleton v Delphi
- Duck typing v Delphi
- Delphi - klávesové zkratky v IDE
- Google se zbláznil?
- Microsoft vydal Service Pack 3 (SP3) pro SQL Serve...
- Delphi 2009 jsou hotové
- SQL Server 2008 jde do výroby
- SQL Server 2008 Release Candidate 0 (RC0)
- SQL Server - odstranění české diakritiky
- Delphi 2008 dotazník
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