Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How are parameters passed to subroutines in perl?

890


Explain cpan?

910


Explain arrays in perl.

882


Who created perl?

879


Explain the difference between declarations of 'my' and 'local' variable scope in perl?

872


Can we load binary extension dynamically?

889


What are the steps involved when the cgi program starts running?

859


Explain grooving and shortening of arrays and splicing of arrays?

845


Which has the highest precedence, List or Terms? Explain?

851


Comment on array slicing and range operator

901


How do I sort a hash by the hash key?

874


Explain what is perl language?

869


What are the advantages of perl programming?

945


What is 'rollback' command in perl?

903


How to prevent file truncation in perl?

939