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
How do you set environment variables in perl?
What is stdin in perl?
What is the difference between use and require in perl programming?
What are the steps involved in configuring a server using cgi programming?
Explain socket programming in perl?
What is cpan in perl?
How to compare two strings in perl?
Explain goto expr?
Define say() function in perl?
Explain the meaning of subroutine?
what are steps to do to lock the sony ericsson mobile with password?
How to open a directory in perl?
How can memory be managed in Perl?
You want to download the contents of a url with perl. How would you do that?
How to replace perl array elements?