Perl: function to trim string leading and trailing whitespace

后端 未结 10 1896
深忆病人
深忆病人 2021-02-01 00:12

Is there a built-in function to trim leading and trailing whitespace such that trim(\" hello world \") eq \"hello world\"?

10条回答
  •  一个人的身影
    2021-02-01 00:43

    Complete howto in the perfaq here: http://learn.perl.org/faq/perlfaq4.html#How-do-I-strip-blank-space-from-the-beginning-end-of-a-string-

提交回复
热议问题