Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arrays 如何删除数组中单个元素的缩进-perl?_Arrays_Perl_Www Mechanize_Www Mechanize Firefox - Fatal编程技术网

Arrays 如何删除数组中单个元素的缩进-perl?

Arrays 如何删除数组中单个元素的缩进-perl?,arrays,perl,www-mechanize,www-mechanize-firefox,Arrays,Perl,Www Mechanize,Www Mechanize Firefox,我有上面的代码,它以这种格式返回以下内容: @para_text[2] = $mech->xpath('/html/body/form/table/tbody/tr[2]/td[3]/table/tbody/tr[2]/td/table/tbody/tr[1]/td/table/tbody/tr[4]', type => $mech->xpathResult('STRING_TYPE')); 我需要采用以下格式: @para_text[2] = $mech->xpath

我有上面的代码,它以这种格式返回以下内容:

@para_text[2] = $mech->xpath('/html/body/form/table/tbody/tr[2]/td[3]/table/tbody/tr[2]/td/table/tbody/tr[1]/td/table/tbody/tr[4]', type => $mech->xpathResult('STRING_TYPE'));
我需要采用以下格式:

@para_text[2] = $mech->xpath('/html/body/form/table/tbody/tr[2]/td[3]/table/tbody/tr[2]/td/table/tbody/tr[1]/td/table/tbody/tr[4]', type => $mech->xpathResult('STRING_TYPE'));
发送日期:2017年3月30日11:59


它们是缩进,而不仅仅是空格,我尝试过grep、trim和其他论坛和线程中建议的各种替换方法,但没有成功。

以下几行可以用来截断多行字符串中的所有空格。我宁愿建议把这些线路投入使用

                                    Sent:


                                    30 March 2017 11:59 

这将删除发送前的空白,但发送后的任何内容仍保留空白