Jun 22, 2008

Count no.of digits in a string

#!F:\Perl\bin\perl -w
use strict;

my($test,$number);
$test = "12344tyyyyy456";
$number = ($test =~ tr/[0-9]/[0-9]/);
print "Number of digits in variable is : $number ";

No comments:

Post a Comment