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 to connect to SQL server through Perl?

1047


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

908


How do you find the length of an array?

961


Define operators used in perl?

933


How to copy a file in perl?

972


What does read () command do?

919


When does circular reference occur?

903


Which statement has an initialization, condition check and increment expressions in its body? Write a syntax to use that statement.

1015


What is the function of cgiwrap in cgi programming?

919


How to read a file into a hash array?

1040


Suppose an array contains @arraycontent=(‘ab’, ‘cd’, ‘ef’, ‘gh’). How to print all the contents of the given array?

962


Explain the internal working of cgi

918


What are perl strings?

882


In Perl, there are some arguments that are used frequently. What are that arguments and what do they mean?

901


how to connect cisco switch uisng perl script

3840