Created
February 2, 2015 22:27
-
-
Save jespr/ec220c41ff84ae30530e to your computer and use it in GitHub Desktop.
Spaces
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: ruby spaces.rb haha 2 | |
# => "h a h a" | |
input, spaces = ARGV[0], ARGV[1] | |
output = "" | |
input.split('').each do |char| | |
output << char | |
output << " " * spaces.to_i | |
end | |
puts output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment