# Copy the return value of a function to the clipboard

**URL:** <https://discourse.julialang.org/t/copy-the-return-value-of-a-function-to-the-clipboard/87112>\
**Category:** Performance\
**Created:** [September 12, 2022, 7:23am UTC](https://discourse.julialang.org/t/copy-the-return-value-of-a-function-to-the-clipboard/87112 "2022-09-12T07:23:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![qwerty](https://avatars.discourse-cdn.com/v4/letter/q/4491bb/32.png) [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Post date:** [September 12, 2022, 7:23am UTC](https://discourse.julialang.org/t/copy-the-return-value-of-a-function-to-the-clipboard/87112/1 "2022-09-12T07:23:11Z")

</div>

I have a function that returns a string, how can I make it so that when the function terminates the result is automatically copied to the clipboard (ctrl + c)? Thank you.

---

<div class="post-metadata">

**Author:** ![YongHee-Kim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yonghee-kim/32/5965_2.png) [@YongHee-Kim](https://discourse.julialang.org/u/YongHee-Kim)\
**Post date:** [September 12, 2022, 7:54am UTC](https://discourse.julialang.org/t/copy-the-return-value-of-a-function-to-the-clipboard/87112/2 "2022-09-12T07:54:10Z")

</div>

You can use `clipboard`

```julia
function foo()
    s = "copy this"
    clipboard(s)
end

```
