How do I remove white space in a Perl string?

后端 未结 12 1830
离开以前
离开以前 2020-12-31 09:34

If I declared a variable $myString with the value \'3 \' (notice the white space). Is there any function to remove the white space for the return v

12条回答
  •  醉梦人生
    2020-12-31 10:01

    I suggest that you make use of the Text::Trim module, which provides ltrim, rtrim, and trim, all of which will trim the parameters passed, or $_ if you give no parameters. It's not a core module so it may need installing

提交回复
热议问题