SHARE
TWEET

Kool London Chat

m_antis Mar 23rd, 2020 (edited) 316 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def to_clipboard(text)
  2.   string = text.to_s
  3.   IO.popen('pbcopy', 'w') {|t| t << text}
  4.   string
  5. end
  6.  
  7. print "Enter message: "
  8. text = gets.chomp!
  9. text = text.chars.map { |m| m == ' ' ? '|' : ":#{m}:" }.join(' ')
  10.  
  11. # verify expected format
  12. puts text
  13.  
  14. to_clipboard(text)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top