getclipboard Synchronous

Read the text currently on the Android clipboard. Use it to import a code or settings string the user copied from another app.

Syntax
Luau
getclipboard() -> string

Parameters

This function takes no arguments.

Returns

string

The clipboard text, or an empty string when the clipboard is empty, holds no text, or cannot be read.

Usage notes

setclipboard applies its value about 50 milliseconds later, so read the clipboard after a short wait when you have just set it yourself.

Example

Example
Luau
local pasted = getclipboard()
if pasted ~= "" then
    print("Clipboard holds", #pasted, "characters")
end