Einzelnen Beitrag anzeigen

paelesoft

Registriert seit: 3. Jul 2004
37 Beiträge
 
Delphi 7 Professional
 

Re: Umlaute aus einem String verändern

  Alt 24. Aug 2004, 18:18
Hab mir dazu mal was geschrieben:
Delphi-Quellcode:
function AnsiInspect(S,look_for,replace_with : string) : string;
var i : Integer;
    D : AnsiString;
begin
  D:='';
  while Length(S)>0 do begin
    i:=Pos(look_for,S);
    if i=0 then begin
      D := D + S; S:='';
    end else begin
      D := D + Copy(S,1,i-1) + replace_with;
      Delete(S,1,i-1 + Length(look_for));
    end;
  end;
  Result := D;
end;

var InpStr,OutStr : string;
begin
  ..... // InpStr füllen
  OutStr:=AnsiInspect(InpStr,'ö','oe');
  OutStr:=AnsiInspect(OutStr,'Ö','Oe');
  OutStr:=AnsiInspect(OutStr,'ä','ae');
  OutStr:=AnsiInspect(OutStr,'Ä','Ae');
.....

end.
Gruß Erik
  Mit Zitat antworten Zitat