Ну, если не гнаться за производительностью, то можно так:
Код:
function ProcessStr(S : String) : String;
var
L : TStringList;
begin
L := TStringList.Create;
Try
// Бъем по запятым
L.Text := StringReplace(S,',',#13#10,[rfReplaceAll]);
While L.Count > 9 Do L.Delete(L.Count-1); // Удаляем все, после 9ой
L.Delete(1); L.Delete(1); // Удаляем 2 блока
// Собираем результат
Result := '';
For I := 0 To L.Count-1 Do
Begin
If Result <> '' Then Result := Result + ', ';
Result := Result + Trim(L[i]);
End;
Finally
L.Free;
End;
end;