Replace Many Character to Number

How can i Replace Many Character in text1 to Number in text2
for example
A to 1
B to 2
C to 3
D to 4

if text in text1=‘abc’ will become text2=‘123’

or if text in text1=‘acb’ will become text2=‘132’

this is my code


i use this code in other app builder

procedure TForm1.Button1Click(Sender: TObject);
  S: string;
  S := Edit1.Text;
  S := S.Replace('A', '1');
  S := S.Replace('B', '2');
  S := S.Replace('C', '3');
  S := S.Replace('D', '4');
  Edit2.Text := S;

As far as I know, Replace is still not currently available as an expression in GDevelop. It’s been asked for, though: "Replace" function for Strings, Text Objects, and Variables