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

Mention what is the difference between a gem and a plugin in ruby?

1 Answers  


Explain me what the difference is between false and nil in ruby?

1 Answers  


What is the difference between extend and include?

1 Answers  


Do you know about dig, float and max?

1 Answers  


Tell me how can we define ruby regular expressions?

1 Answers  


In how many ways items can be added in an array in Ruby?

1 Answers  


Explain about normal method class?

1 Answers  


Explain retry statement in ruby.

1 Answers  


Explain redo statement in Ruby?

1 Answers  


What are class libraries in Ruby?

1 Answers  


difference between activesupport's “hashwithindifferentaccess” and ruby's “hash”?

1 Answers  


Is ruby a strongly typed or a weakly typed language?

1 Answers  


Categories