Results for “Strings & byte buffers”
Small, practical examples. Search by task or narrow things down below.
Measure a short text value
TypeScript: Read the length of an ASCII string. Non-ASCII text may use multiple code units or bytes depending on the language.
TypeScript✓ Tested
Measure a short text value
C++: Read the length of an ASCII string. Non-ASCII text may use multiple code units or bytes depending on the language.
C++✓ Tested
Measure a short text value
C: Read the length of an ASCII string. Non-ASCII text may use multiple code units or bytes depending on the language.
C✓ Tested
Pack and unpack a network-order integer
Python: Use an explicit byte order so the binary format is independent of the host architecture.
Python✓ Tested
Pad a numeric label
Convert a number to text and pad it to a fixed width.
JavaScript✓ Tested
Parse and format a date
Convert a date string into a datetime object, then format it in a different, human-readable order.
date✓ Tested
Print integers in different bases
Inspect a byte in decimal, hexadecimal, and binary.
Serial✓ 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
Read one character from serial input
Wait for an incoming byte without blocking the main loop.
Serial.available✓ Tested
Read rows from CSV text
Parse CSV into objects with named properties.
CSV✓ Tested
Read serial text up to a delimiter
Arduino / C: readBytesUntil excludes the delimiter and does not add a null terminator.
Arduino / C✓ Tested
Reject an unsupported settings version
Arduino / C: A version byte lets firmware fall back when stored settings use another format.
Arduino / C✓ Tested