频道分类

Delphi 字符串变形替换

作者:admin 来源: 日期:2020/2/7 22:30:45 人气: 标签:

 

function RemoveAcento(aText : string) : string;
const
  ComAcento = '1234567890';
  SemAcento = 'abcdefghij';
var
  x: Cardinal;
begin;
  for x := 1 to Length(aText) do
    if (Pos(aText[x], ComAcento) <> 0) then
      aText[x] := SemAcento[ Pos(aText[x], ComAcento) ];
  Result := aText;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Text:=RemoveAcento('123123');    //结果abcabc
end;