I have written this function to copy text to clipboard. It copies content but it add line feeds to the string copied.