mirror of
https://github.com/jbranchaud/til
synced 2026-01-04 23:58:01 +00:00
Add Squeeze Out The Extra Space as a ruby til.
This commit is contained in:
@@ -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)
|
- [Finding The Source of Ruby Methods](ruby/finding-the-source-of-ruby-methods.md)
|
||||||
- [Limit Split](ruby/limit-split.md)
|
- [Limit Split](ruby/limit-split.md)
|
||||||
- [Parallel Bundle Install](ruby/parallel-bundle-install.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)
|
- [Summing Collections](ruby/summing-collections.md)
|
||||||
|
|
||||||
### vim
|
### vim
|
||||||
|
|||||||
8
ruby/squeeze-out-the-extra-space.md
Normal file
8
ruby/squeeze-out-the-extra-space.md
Normal file
@@ -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"
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user