Programming Languages
C#
Subjective
Mar 13, 2013
How can you replace the characters from a string and save the number of replacements?
Detailed Explanation
#!usr/bin/perl
use strict;
use warnings;
my $string="APerlAReplAFunction";
my $counter = ($string =~ tr/A//);
print "There are $counter As in the given string\n";
print $string;
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts