Skip to content

Instantly share code, notes, and snippets.

@timothyandrew
Created October 14, 2011 11:37
Show Gist options
  • Save timothyandrew/1286872 to your computer and use it in GitHub Desktop.
Save timothyandrew/1286872 to your computer and use it in GitHub Desktop.
remove spaces
#!/usr/bin/env ruby
str = " this is some text with spaces in it "
puts str.split.join
#Output: thisissometextwithspacesinit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment