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 / tanu

$str='Hello';
$cnt= ($str=~s/l/i/g);
print $cnt;

$cnt stores the number of replacements.

Is This Answer Correct ?    20 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

910


Explain subroutine in perl?

895


What are the logical operators used for small scale operations? Explain them briefly.

966


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

980


What are scalar data and scalar variables?

1103


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

998


What is the difference between die and exit in perl?

984


How to know whether a key exists or not in perl?

967


Explain a tell function in perl?

950


What happens in dereferencing?

1026


what are the steps involved in reading a cgi script on the server?

916


How do I read command-line arguments with Perl?

1006


Explain strftime() function in perl?

920


What is boolean context?

979


What is -> symbol in perl?

992