> ## Documentation Index
> Fetch the complete documentation index at: https://docsuncv2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# toclipboard

Writes `\r` followed by `text` to the user's clipboard.

```luau theme={null}
toclipboard(text: string): ()
```

The resulting clipboard contents start with a <abbr title="ASCII byte 13. Historically moved a typewriter or terminal cursor back to the start of a line.">carriage return byte</abbr> (`0x0D`), then the input string. Not equivalent to `setclipboard`, which writes a `string` argument without any prefix.

## Parameters

| Parameter | Type     | Description                                        |
| --------- | -------- | -------------------------------------------------- |
| `text`    | `string` | The text written after the carriage return prefix. |

## Returns

<code title="the function does not return a value.">void</code>

## Aliases

* `write_clipboard`

## Example

<CodeGroup>
  ```luau Example 1 theme={null}
  <<<<<<< HEAD
  toclipboard("text to copy")
  =======
  -- toclipboard(text: string): ()
  >>>>>>> 50e30f53759b0538759af25c9b271514aa2c9290
  ```

  ```luau Example 2 theme={null}
  toclipboard("hello")
  -- paste anywhere and you'll see "\rhello"
  ```
</CodeGroup>

<Tip>
  Always check parameters and return values when working with this library function.
</Tip>
