t110_insert.pas 441 B

1234567891011121314151617181920212223242526
  1. program t110_insert;
  2. { t110 -- Insert(Source, Dest, Index): char and string sources, middle/end/
  3. front, and index clamping. }
  4. var
  5. S : string[20];
  6. C : char;
  7. begin
  8. S := 'ace';
  9. C := 'b';
  10. Insert (C, S, 2);
  11. writeln (S);
  12. S := 'ace';
  13. Insert ('b', S, 2);
  14. writeln (S);
  15. S := 'ace';
  16. Insert ('XY', S, 4);
  17. writeln (S);
  18. S := 'ace';
  19. Insert ('Z', S, 99);
  20. writeln (S);
  21. S := 'ace';
  22. Insert ('Z', S, 0);
  23. writeln (S)
  24. end.