converte a string para Maiuscula
function ToUpper(Text: String): String;
var
Ind: Integer;
const
LW = 'áâãàéêíóôõúüûçñ';
UP = 'ÁÂÃÀÉÊÍÓÔÕÚÜÛÇÑ';
begin
Result := '';
for Ind := 1 to Length(Text) do
if Pos(Copy(Text, Ind, 1), LW) > 0 then
Result := Result + Copy(UP, Pos(Copy(Text, Ind, 1), LW), 1)
else
Result := Result + UpperCase(Copy(Text, Ind, 1));
end;
E a segunda função converte a string para minúscula:
function ToLower(Text: String): String;
var
Ind: Integer;
const
LW = 'áâãàéêíóôõúüûçñ';
UP = 'ÁÂÃÀÉÊÍÓÔÕÚÜÛÇÑ';
begin
Result := '';
for Ind := 1 to Length(Text) do
if Pos(Copy(Text, Ind, 1), UP) > 0 then
Result := Result + Copy(LW, Pos(Copy(Text, Ind, 1), UP), 1)
else
Result := Result + LowerCase(Copy(Text, Ind, 1));
end;
terça-feira, 16 de setembro de 2008
Assinar:
Postar comentários (Atom)
Nenhum comentário:
Postar um comentário