Eventuell könnte dashier schon reichen, ist aber ungetestet:
Delphi-Quellcode:
function longestNumber(s : string) : byte;
var run, number : byte;
begin
longestNumber := 0;
number := 0;
for run := 1 to length(s) do
begin
case s[run] of
'0'..'9' : inc(number);
else
begin
if number > longestNumber then longestNumber := number;
number := 0;
end;
end;
end;
if number > longestNumber then longestNumber := number;
end;