Skip to content

Instantly share code, notes, and snippets.

@hkdnet
Created October 18, 2015 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hkdnet/c9478785f135413c5b1e to your computer and use it in GitHub Desktop.
Save hkdnet/c9478785f135413c5b1e to your computer and use it in GitHub Desktop.
def hoge(a, b, c, e, n)
[a, b, c, e, n].reject(&:nil?).each(&:strip!)
p a
p b
p c
p e
p n
end
hoge("a ", "b ", " c ", "", nil)
# "a"
# "b"
# "c"
# ""
# nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment