FIND YOUR NEXT FEW LINES

Results for “C”

Small, practical examples. Search by task or narrow things down below.

3000 snippets foundClear filters
RustErrors & optional values

Keep an optional value only when valid

Keep an optional value only when valid in a complete Rust program using the standard library.

Rust✓ Tested
HTMLData & disclosure

Label a data table

Use a caption and scoped headers for an HTML data table.

HTML✓ Tested
GoTesting & reusable helpers

Limit the bytes read from a stream

Limit the bytes read from a stream using a complete Go program with explicit sample inputs.

Go✓ Tested
PythonFiles & paths

List files in a folder

List the names of regular files in a folder in alphabetical order, excluding subdirectories.

directory✓ Tested
JavaFiles & paths

List regular files

List immediate regular files in sorted order and close the Java directory stream.

Java✓ Tested
GoGetting Started

Look up a map entry

Look up a map entry using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsLoops & decisions

Loop over an array safely

Preserve spaces in array elements while iterating.

array✓ Tested
JavaDates & time zones

Measure a duration between instants

Java: Use Duration for elapsed timeline time and retrieve total seconds.

Java✓ Tested
PythonGetting Started

Measure a short text value

Python: Read the length of an ASCII string. Non-ASCII text may use multiple code units or bytes depending on the language.

Python✓ Tested
JavaGetting Started

Measure a short text value

Java: Read the length of an ASCII string. Non-ASCII text may use multiple code units or bytes depending on the language.

Java✓ Tested
jQueryEvents

Mirror input text

Update a result as the user types using a jQuery input event.

jQuery✓ Tested
RustGetting Started

Modify a value through a mutable borrow

Modify a value through a mutable borrow in a complete Rust program using the standard library.

Rust✓ Tested