How would you replace a char in string and how do you store
the number of replacements?
Answer Posted / ananth_s
#!usr/bin/perl
use strict;
use warnings;
my $string="XmanXseriesx";
my $count = ($string =~ tr/X//);
print "There are $count Xs in the string\n";
print $string;
Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
Explain split function in perl?
Explain the internal working of cgi
Why to use perl?
What are scalar data and scalar variables?
What is eval function in perl?
How do I replace every TAB character in a file with a comma?
What's the difference between /^Foo/s and /^Foo/?
How does polymorphism work in perl?
What is the tk module?
For a situation in programming, how can you determine that Perl is a suitable?
What is the different between array and hash in perl programming?
What does redo statement do in perl?
You want to connect to sql server through perl. How would you do that?
Who created perl?
What is perl pop array function?