FIND YOUR NEXT FEW LINES

Results for “Strings & byte buffers”

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

195 snippets foundClear filters
CDynamic memory & ownership

Initialize a byte buffer to zero

C: memset initializes each byte to the chosen unsigned-char value.

C✓ Tested
Arduino / CGetting Started

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
Arduino / CSerial protocols

Inspect a byte without consuming it

Arduino / C: peek leaves the next byte available for a later read.

Arduino / C✓ Tested
Linux CommandsStreams & byte tools

Inspect bytes as hexadecimal values

Linux Commands: Use od with explicit formatting and no address column.

Linux Commands✓ Tested
PowerShellStrings & literal text

Join several strings with a separator

PowerShell: The join operator returns one string from an input collection.

PowerShell✓ Tested
PythonStrings & dates

Join strings with a separator

Combine a list of strings into one readable string with a separator between each item.

string✓ Tested
JavaStrings

Join strings with a separator

Build a Java string from several values using String.join.

Java✓ Tested
C++Strings

Join strings with a separator

Use an output string stream to join C++ values without a trailing separator.

C++✓ Tested
GoTesting & reusable helpers

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
C#JSON & binary formats

Measure the byte length of UTF-8 text

C#: Character count and encoded byte count can differ for non-ASCII text.

C#✓ Tested
JavaEncoding & structured values

Measure UTF-8 bytes separately from characters

Java: Encode a Java string before measuring its serialized byte length.

Java✓ Tested
C#Text validation & encoding

Normalize canonically equivalent Unicode strings

C#: Normalize to NFC before an ordinal comparison of equivalent character sequences.

C#✓ Tested