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 do the following methods differ: @my_string.strip and @my_string.strip! ?



How do the following methods differ: @my_string.strip and @my_string.strip! ?..

Answer / Ramniwas

"@my_string.strip removes leading and trailing whitespaces from a string, but it does not change the original string. On the other hand, @my_string.strip! modifies the original string by removing the leading and trailing whitespaces and returns nil."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby Interview Questions

Can you please explain what is the difference between string and symbol?

1 Answers  


How to use sql db or mysql db. Without defining it in the database.yml

1 Answers  


What are the different environment variables present in the ruby?

1 Answers  


What is the scope of a local variable in ruby?

1 Answers  


Explain about operators in Ruby?

1 Answers  


Write the command to get installed Ruby version in your system?

1 Answers  


Explain Ruby exceptions?

1 Answers  


How to read a file in Ruby?

1 Answers  


What is Ruby programming language?

1 Answers  


What is the difference between “#==” and “#equal?”

1 Answers  


What things we can define in the model?

1 Answers  


In how many ways items can be removed from array in Ruby?

1 Answers  


Categories