StringReplace x Array

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 the StringReplace look for any name inside the array and replace it. Where am I going wrong?

    
asked by anonymous 20.09.2014 / 03:59

1 answer

4

As far as I can understand what you've presented, you need to change in the vector the name you typed in edit with 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;
    
20.09.2014 / 16:26