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

Write an example explaining the use of symbol tables.

1003


You want to add two arrays together. How would you do that?

940


Explain ivalue?

1052


how to connect cisco switch uisng perl script

3901


What can be done for efficient parameter passing in perl? Explain.

1084


We all know private variables exist in perl. But do private METHODS exist in perl ? Eg ?

2565


Which feature of perl provides code reusability?

1051


Explain what is lvalue?

1074


What is -> symbol in perl?

1058


What are the logical operators used for small scale operations?

1004


what is the main function of fork() in cgi programming?

1218


How can I display all array element in which each element will display on next line in perl ?

991


What is perl programming?

1076


Explain gmtime() function in perl?

1025


Create a function that is only available inside the scope where it is defined ?

1057