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

What does the’$_’ symbol mean?

1048


Which functions in Perl allows you to include a module file or a module and what is the difference between them?

1089


What is the function of virtual documents in cgi programs?

1003


What is the easiest way to download the contents of a URL with Perl?

991


Perl uses single or double quotes to surround a zero or more characters. Are the single(' ') or double quotes (" ") identical?

965


what are the strategies followed for multiple form interaction in cgi programs?

985


“The methods defined in the parent class will always override the methods defined in the base class”. What does this statement means?

1061


How to connect with sqlserver from perl and how to display database table info?

998


There are two types of eval statements i.e. Eval expr and eval block. Explain them.

1092


What is subroutine in perl?

987


What does last statement do in perl?

1063


How to read file into hash array ?

1166


What is the difference between use and require in perl?

913


Elaborate on perl bite-wise operators.

960


What are prefix dereferencer?

987