Stringreplace x Array

Asked

Viewed 243 times

1

I have the following code:

 Nomes: array[1..10] of string=('Tadeu','Joao','Maria','Ana','Juca','leticia');
 StringReplace(Edit1.Text, Nomes, 'Bloqueado', [rfReplaceAll]);

I need to make Stringreplace look for any name that is inside the array and replace it. Where I am missing ?

  • OK thanks @Tiagosilva for the tip.

1 answer

4


From what I could understand of what you presented, need to change in the vector the name typed in Edit at value 'Bloqueado'.

You will have to register by vector registration.

var
  I: integer;
begin
  for I := Low(Nomes) to High(Nomes) do
    Nomes[I] := StringReplace(Nomes[I], Edit1.Text, 'Bloqueado', [rfReplaceAll]);
...
end;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.