我发现了许多与此相关的问题,但没有任何帮助我解决它的问题.因为我缺乏专业知识.
html_entity_decode我相信PHP 本来可以帮助,但Perl不会.
在我的MySQL数据库中,我' "在描述中有以下长度:12' 6"
我希望它显示为12'6".
我试过了:
$string =~ s/:[']:/'/g;
$string =~ s/:["]:/"/g;
$string =~ s/'/'/g;
$string =~ s/"/"/g;
$string =~ s/\'/'/g;
$string =~ s/\"/"/g;
$string =~ s/\'/\'/g;
$string =~ s/\"/\"/g;
perl -pi -e 's:':':g' $_; #crashes.
perl -pi -e 's:":":g' $string #also crashes.
system -pi -e 's:':':g' $_; #crashes.
system -pi -e 's:":":g' $string #also crashes.
Run Code Online (Sandbox Code Playgroud)
我很茫然.有人可以帮忙吗?
use warnings;
use strict;
use HTML::Entities;
my $str = '12' 6"';
print decode_entities($str);
Run Code Online (Sandbox Code Playgroud)