copyToClipboard function

Copy data to the clipboard