function StrSum(str: string):integer;
var
i,n: integer;
begin
n:=0;
for i := 1 to length(str) do
begin
if str in ['0'..'9'] then
n:=n+ord(str)-ord('0');
end;
result:=n;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
caption:=inttostr(StrSum('700706111600002'));
end;