DelphiFAQ Home Search:
General :: Programming :: Delphi :: Strings
Algorithms for string handling problems, implemented in Delphi but useful for any procedural language.


This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

CompareString() versus AnsiCompareString()


What is the difference between CompareString() and AnsiCompareString()?

Stefan Hoffmeister explains:

Some languages have characters outside of the ASCII character set; these two strings will compare differently depending on whether you use CompareString or AnsiCompareString:


'' is a German character, and with AnsiCompareString, the correct lexical order returned would be different:

AnsiCompareString observes the lexical order of your current locale - while CompareString only looks at the bits and bytes of the data. If you want to compare 'text', then do use AnsiCompareString. If you want to compare ASCII-only text (or just bytes), then use CompareString.

Generated 12:01:41 on Jan 22, 2018