How to remove the first N characters from a string in Pascal

1 Answer

0 votes
program RemoveFromString;

var
  str: string;
  N: Integer;

begin
  str := 'abcdefghijklmnop';
  N := 7;

  // Slice the string starting from the Nth index
  Delete(str, 1, N); // Deletes the first N characters from the string

  // Print the resulting string
  WriteLn(str);
end.



(*
run:

hijklmnop

*)

 



answered Apr 24, 2025 by avibootz
...