Results for “Strings & byte buffers”
Small, practical examples. Search by task or narrow things down below.
Initialize a byte buffer to zero
C: memset initializes each byte to the chosen unsigned-char value.
C✓ Tested
Inspect a byte as hexadecimal
Arduino / C: Inspect a byte as hexadecimal on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Inspect a byte without consuming it
Arduino / C: peek leaves the next byte available for a later read.
Arduino / C✓ Tested
Inspect bytes as hexadecimal values
Linux Commands: Use od with explicit formatting and no address column.
Linux Commands✓ Tested
Join several strings with a separator
PowerShell: The join operator returns one string from an input collection.
PowerShell✓ Tested
Join strings with a separator
Combine a list of strings into one readable string with a separator between each item.
string✓ Tested
Join strings with a separator
Build a Java string from several values using String.join.
Java✓ Tested
Join strings with a separator
Use an output string stream to join C++ values without a trailing separator.
C++✓ Tested
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
Measure the byte length of UTF-8 text
C#: Character count and encoded byte count can differ for non-ASCII text.
C#✓ Tested
Measure UTF-8 bytes separately from characters
Java: Encode a Java string before measuring its serialized byte length.
Java✓ Tested
Normalize canonically equivalent Unicode strings
C#: Normalize to NFC before an ordinal comparison of equivalent character sequences.
C#✓ Tested