per 3.1

$stringvar = "aby";
  $stringvar++;
print $stringvar;      # abz

$stringvar = "acz";
  $stringvar++;
print $stringvar;      # ada  进一位了

$stringvar = "AGZZZ";
  $stringvar++; # $stringvar now contains "AHAAA"

$stringvar = "bc999";
  $stringvar++; # $stringvar now contains "bd000"

如果字符串中含有非字母且非数字的字符,或数字位于字母中,则经过++运算前值转换为数字零,因此结果为1,如:
  $stringvar = "ab*c";
  $stringvar++;    #1
  $stringvar = "ab5c";
  $stringvar++;  #1
字符串联结和重复操作符
  联接: .
  重复:x
  联接且赋值(类似+=): .=
例:
  $newstring = "potato" . "head";
  $newstring = "t" x 5;
  $a = "be";
  $a .= "witched"; # $a is now "bewitched"

 

 

你可能感兴趣的:(C++,c,C#)