Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.184 Beiträge
Delphi 12 Athens
|
Re: Groß u. Kleinschreibung eines Strings umkehren
25. Feb 2009, 08:29
Delphi-Quellcode:
function SwitchLowerUpper(const Value: String): String;
var
i: Integer;
begin
Result := Value;
for i := 1 to Length(Result) do
if Result[i] in ['a'..'z', 'ä', 'ö', 'ü', 'A'..'Z', 'Ä', 'Ö', 'Ü'] then
Result[i] := Chr(Ord(Result[i]) xor $20);
Delphi-Quellcode:
function SwitchUpperLower(Value: String): String;
var
uValue: String;
i: Integer;
begin
Result := LowerCase(Value);
uValue := UpperCase(Value);
for i := 1 to Length(Result) do
if Result[i] = Value[i] then
Result[i] := uValue[i];
end;
$2B or not $2B
|
|
Zitat
|