Functions Delphi

Title: LoCase function
Question: How to convert an upper char to a lower char ?
Answer:
...
uses System;
...
function LoCase(AChr: Char): Char;
begin
if AChr in ['A'..'Z'] then
Result := Chr(Ord(AChr) + (Ord('a') - Ord('A')))
else
Result := AChr;
end;
or if you prefer an ASM version
-------------------------------
function LoCase(AChr: Char): Char;
asm
CMP AL, 'A'
JB @@exit
CMP AL, 'Z'
JA @@exit
ADD AL, 'a' - 'A'
@@exit:
end;