Perl 之 chomp 用法

chomp 語法 chomp VARIABLE chomp( LIST ) chomp 是 chop 的安全版本,相對於chop 刪除字符串或list最後任意字符。 chomp 只刪除 '\n',不然不刪除。 VARIABLE == string 例1:$str="test function of chomp\n"; chomp($str);#去掉結尾的\n 例2:$str=<STDIN
相關文章
相關標籤/搜索