Results for “format”
Small, practical examples. Search by task or narrow things down below.
Partition a collection by a predicate
Java: Use partitioningBy to retain both matching and nonmatching values.
Java✓ Tested
Partition values into two collections
Partition values into two collections in a complete Rust program using the standard library.
Rust✓ Tested
Print a number with two decimal places
Python: Format a small decimal value consistently for display.
Python✓ Tested
Print a number with two decimal places
C#: Format a small decimal value consistently for display.
C#✓ Tested
Print a number with two decimal places
Java: Format a small decimal value consistently for display.
Java✓ Tested
Print a number with two decimal places
JavaScript: Format a small decimal value consistently for display.
JavaScript✓ Tested
Print a number with two decimal places
TypeScript: Format a small decimal value consistently for display.
TypeScript✓ Tested
Print a number with two decimal places
C++: Format a small decimal value consistently for display.
C++✓ Tested
Print a number with two decimal places
C: Format a small decimal value consistently for display.
C✓ Tested
Process the lines of an in-memory string
Java: Use String.lines to handle common line terminators without retaining them.
Java✓ Tested
Quote a CSV field and double embedded quotes
C: A quoted CSV field represents a quote character by repeating it.
C✓ Tested
Read a big-endian binary integer
C#: Use BinaryPrimitives when the protocol byte order differs from or must not depend on the host.
C#✓ Tested