像我的@fields = split(/ $delimiter /,$string);不行有什么想法吗?
输入:
abcd|efgh|23
预期产量:
abcd efgh 23
选项1:
$delimiter = quoteMeta($delimiter); my @fields = split /$delimiter/,$string;
选项二:
my @fields = split /\Q$delimiter/,$string;