logo

How to Use Clipboard in Julia 📂Julia

How to Use Clipboard in Julia

Overview

Introducing how to use the clipboard in Julia.

Code

clipboard is implemented with two methods.

clipboard(x)

Copies x to the clipboard.

clipboard()

Pastes from the clipboard.

How to Use Outside the REPL

using InteractiveUtils: clipboard

Outside the REPL, the clipboard function cannot be used, so you must import the clipboard function from InteractiveUtils as shown above1.

Full Code

using InteractiveUtils: clipboard

clipboard("julia")
x = clipboard()

Environment

  • OS: Windows
  • julia: v1.10.0