perl字符串操做符

.操做符html

点操做符用于链接字符串,例如:markdown

my $string1 = "i love ";
my $string2 = "china \n";

print $string1 . $string2;

运行结果:
i love chinapost

x操做符spa

字母x是表明字符串重复操做符,左操做数是表明要重复的字符串,右操做数表明要重复的次数,该操做数通常都会被转换成整数,例如:code

my $string3 = "china " x 3;

print $string3, "\n";

运行结果:
china china chinahtm

转载于:https://www.cnblogs.com/jinxiang1224/p/8468191.htmlblog