ruby strip vs strip!
Thursday 11/27/2008 – Category: Uncategorized
Sorry to disappoint, but this entry isn't about strippers.
str.strip returns a copy of string str with with whitespace chopped off, while str.strip! returns the same string str or nil if the string wasn't altered.
I didn't realize str.strip! would return nil until I was getting a lot of empty strings back...
Leave a Reply
Recent Posts
- LED Light for iPhone 4
(Monday 06/28/2010 – 38 Comments) - WWDC 2010: Worth Every Minute
(Monday 06/14/2010 – No Comments) - Flickr Original for Safari 5!
(Wednesday 06/9/2010 – 15 Comments) - iPad thoughts
(Friday 04/2/2010 – 1 Comment)
