Examples

XCODX

Code Examples

Short, copy-paste, runnable snippets for the tasks you do all the time.

A cookbook of small, focused examples. Each entry solves a common task in a few lines, runs in the browser, and links to a deeper reference or how-to when you want the full story. It's the fastest way to grab a working snippet and get back to what you were doing.

Every example is tested and runnable — copy it as-is, or edit it in place to fit your data. Browse by language below.

Frequently asked questions

Can I copy these examples into my project?
Yes — that's the point. Each snippet is short, self-contained and tested. Copy it as-is or tweak it in the embedded editor first.
Are the outputs shown correct?
Yes. Every example is executed before publishing and the shown output matches what the code actually produces.
Where do I go for more detail?
Each example links to the relevant reference page (for the full behaviour of a method) or how-to guide (for the task in depth).