FIND YOUR NEXT FEW LINES

Results for “Text semantics”

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

432 snippets foundClear filters
RustStrings & Unicode

Trim whitespace around text

Trim whitespace around text in a complete Rust program using the standard library.

Rust✓ Tested
CSSGetting Started

Underline meaningful text

CSS: Learn how to underline meaningful text in a complete browser example.

CSS✓ Tested
ReactContext & shared state

Update state shared through context

Update state shared through context with a small React component and explicit browser behavior.

React✓ Tested
ReactContext & shared state

Use a context’s fallback value

Use a context’s fallback value with a small React component and explicit browser behavior.

React✓ Tested
HTMLInput constraints

Validate a structured text identifier

HTML: The pattern attribute matches the entire nonempty input; required handles the empty case.

HTML✓ Tested
ReactContext & shared state

Validate access through a custom context hook

Validate access through a custom context hook with a small React component and explicit browser behavior.

React✓ Tested
GoErrors & validation

Wrap an error with context

Wrap an error with context using a complete Go program with explicit sample inputs.

Go✓ Tested
PythonFiles & paths

Write a text file

Save a string to a UTF-8 text file and close the file automatically when the write finishes.

file✓ Tested
C#Files & paths

Write a text file

Write a C# string to a UTF-8 file.

C#✓ Tested
C++Files & paths

Write a text file

Write and close a C++ output file while checking stream failure.

C++✓ Tested
CFiles

Write a text file

Open, write, and close a C file while checking every operation.

C✓ Tested
C++Filesystem operations

Write and read bytes without text conversion

C++: Use binary stream modes and check each I/O operation before consuming its result.

C++✓ Tested