FIND YOUR NEXT FEW LINES

Results for “to_char”

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

211 snippets foundClear filters
Linux CommandsTransforming text

Remove carriage-return characters

Linux Commands: Use tr -d to remove CR characters from Windows-style line endings.

Linux Commands✓ Tested
JavaScriptRegular expressions & URL encoding

Split text on several separator characters

JavaScript: A regex character class can recognize alternative simple delimiters.

JavaScript✓ Tested
TypeScriptRegular expressions & URL encoding

Split text on several separator characters

TypeScript: A regex character class can recognize alternative simple delimiters.

TypeScript✓ Tested
RustStrings & Unicode

Take Unicode characters without byte slicing

Take Unicode characters without byte slicing in a complete Rust program using the standard library.

Rust✓ Tested
CStrings & byte buffers

Find the final path separator

C: strrchr locates the last matching character without modifying the input.

C✓ Tested
C++Numeric parsing & calculations

Format an integer into a caller-owned buffer

C++: to_chars avoids allocation and reports whether the buffer was large enough.

C++✓ Tested
C++Numeric parsing & calculations

Parse a complete integer without exceptions

C++: from_chars reports both an error code and the first unconsumed character.

C++✓ Tested
Arduino / CArrays & embedded state

Advance an index around a fixed collection

Arduino / C: Modulo wraps a bounded nonnegative index to zero.

Arduino / C✓ Tested
CDynamic memory & ownership

Allocate an independent copy of a C string

C: Include one extra byte for the terminating null character.

C✓ Tested
Arduino / CSensor calculations

Apply a linear sensor calibration

Arduino / C: Convert a raw reading using an offset and scale measured for the sensor.

Arduino / C✓ Tested
Arduino / CBinary values & packets

Assemble a big-endian 16-bit value

Arduino / C: Cast to an unsigned 16-bit type before shifting the high byte.

Arduino / C✓ Tested
Arduino / CBinary values & packets

Assign a bit from a Boolean state

Arduino / C: bitWrite accepts a bit position and a zero or nonzero value.

Arduino / C✓ Tested