1.

How Would You Replace A Char In String And How Do You Store The Number Of Replacements?

Answer»

$str='Hello';
$CNT= ($str=~s/l/i/g);
PRINT $cnt;

$str='Hello';
$cnt= ($str=~s/l/i/g);
print $cnt;



Discussion

No Comment Found