Delete(Str: String; Start, Length: Integer)

Hello.
can u help me.
I have a code:
[code]procedure Tpa.Button2Click(Sender: TObject);
var
Temp: TStringList;
Index: Integer;
s: Integer;
begin
Temp:= TStringList.Create();
try
for Index:= 0 to FList.Count - 1 do
if ('apple', FList[Index]) <> 0) and (Temp.IndexOf(FList[Index]) = -1)
then Temp.Add(FList[Index]);
try
begin
Temp.SaveToFile('fruits.txt');
end;
except
ShowMessage('error!');
end;
finally
Temp.Free();
end;
end;[/code]
and i need use in this button functions "Delete(Str: String; Start, Length: Integer)".
and i need use in this button functions "Delete(Str: String; Start, Length: Integer)".
I need to remove all 'garbage' after this word.
How do I do this?
example:
'apple ererewerwer'
result:
only 'apple'
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories