Archives

Posts Tagged ‘汉字’

Perl中得到汉字和英文长度 sub length_china(){ if(@lc=$_=~/[\x80-\xff]{3}|\w/gi){ return scalar @lc;         } } 因为在Perl中汉字有三个字节,做for循环时不方便,所以修改了一下,用上面...

2,393 views | No comments
Dec 13th, 2008 | Filed under Perl
Tags: ,