From 5e92101c6f71ccdf49a2b1ed2dfdbc8a75cebf0e Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Wed, 29 Apr 2015 20:28:18 -0500 Subject: [PATCH] Add Squeeze Out The Extra Space as a ruby til. --- README.md | 1 + ruby/squeeze-out-the-extra-space.md | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 ruby/squeeze-out-the-extra-space.md diff --git a/README.md b/README.md index 0e6465a..11cb0d2 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ smart people at [Hashrocket](http://hashrocket.com/). - [Finding The Source of Ruby Methods](ruby/finding-the-source-of-ruby-methods.md) - [Limit Split](ruby/limit-split.md) - [Parallel Bundle Install](ruby/parallel-bundle-install.md) +- [Squeeze Out The Extra Space](ruby/squeeze-out-the-extra-space.md) - [Summing Collections](ruby/summing-collections.md) ### vim diff --git a/ruby/squeeze-out-the-extra-space.md b/ruby/squeeze-out-the-extra-space.md new file mode 100644 index 0000000..5b85934 --- /dev/null +++ b/ruby/squeeze-out-the-extra-space.md @@ -0,0 +1,8 @@ +# Squeeze Out The Extra Space + +Remove all the excess spaces from a string using the squeeze method: + +```ruby +> "this is a string".squeeze(' ') +=> "this is a string" +```