VOOZH about

URL: https://www.geeksforgeeks.org/perl/perl-chop-function/

⇱ Perl | chop() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Perl | chop() Function

Last Updated : 11 Jul, 2025
The chop() function in Perl is used to remove the last character from the input string.
Syntax: chop(String) Parameters: String : It is the input string whose last characters are removed. Returns: the last removed character.
Example 1: Output:
Chopped String is : GfG is a computer science porta
Removed character is : l
Example 2: Output :
Chopped String is : [1, 2, 3
Removed character is : ]
Comment
Article Tags:

Explore