文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>写一个函数 参数是一个字符串,返回字符串中的英..

写一个函数 参数是一个字符串,返回字符串中的英..

时间:2007-09-17  来源:starB6

#!perl -w   print "please input the String:\n";
  my $data = <STDIN>;
  chomp($data);
 
  &ABC($data);
 
  sub ABC
  {       
    chomp(@_);
     my ($str) = @_;
     my $i;
     my $count=0;
     my $lent = length($str);  
    for ( $i=0;$i<=$lent; $i++)
    {    
        my $str_current = substr($str,$i,1);   
        chomp($str_current); 
        if ($str_current =~ /[a-zA-Z]/)
        {
         $count++;
         }     
     } 
     print "the total is ::::::$count\n";
 }
相关阅读 更多 +
排行榜 更多 +
打螺丝高手

打螺丝高手

模拟经营 下载
解救火柴人计划安卓版

解救火柴人计划安卓版

体育竞技 下载
鸡生化精英安卓版

鸡生化精英安卓版

飞行射击 下载