Perl中chomp和chop的區別

chomp是用來刪除換行符. [root@rs1 ~]# cat t.pl #!/usr/bin/perl my $c="I love me"; chomp($c); print "$c/n"; [root@rs1 ~]# ./t.pl I love me [root@rs1 ~]# chop是用來刪除最後一個字符. [root@rs1 ~]# cat t.pl #!/usr/bin/perl m
相關文章
相關標籤/搜索