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
- Marble Paint
(Friday 02/4/2011 – 1 Comment) - More Flickr Original Updates
(Sunday 01/23/2011 – 13 Comments) - Flickr Original updates
(Saturday 08/7/2010 – 19 Comments) - LED Light for iPhone 4
(Monday 06/28/2010 – 65 Comments)
