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 do you set environment variables in perl?

1050


What is stdin in perl?

973


What is the difference between use and require in perl programming?

943


What are the steps involved in configuring a server using cgi programming?

908


Explain socket programming in perl?

918


What is cpan in perl?

958


How to compare two strings in perl?

948


Explain goto expr?

882


Define say() function in perl?

972


Explain the meaning of subroutine?

976


what are steps to do to lock the sony ericsson mobile with password?

2207


How to open a directory in perl?

1116


How can memory be managed in Perl?

1062


You want to download the contents of a url with perl. How would you do that?

879


How to replace perl array elements?

953