FIND YOUR NEXT FEW LINES

Results for “length”

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

64 snippets foundClear filters
SQLiteText cleanup & matching

Measure the length of ordinary text

SQLite: Use the engine’s text-length function; this ASCII example has no trailing spaces.

SQLite✓ Tested
JavaFile operations & binary data

Read a file length in bytes

Java: Files.size inspects metadata without loading the file into a Java string.

Java✓ Tested
Bash ScriptsParameter expansion

Read a string’s character length

Bash Scripts: Bash parameter length counts characters under the current locale.

Bash Scripts✓ Tested
Bash ScriptsGetting Started

Read the length of an ASCII string

Bash Scripts: Read the length of an ASCII string with a small standalone Bash program.

Bash Scripts✓ Tested
AngularTemplate-driven forms

Require a minimum text length

Require a minimum text length with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
Linux CommandsStreams & byte tools

Set a file to a specific byte length

Linux Commands: Use truncate to shorten a known scratch file without replacing its inode.

Linux Commands✓ Tested
CDynamic memory & ownership

Store a variable-length payload after a structure header

C: A flexible array member lets one allocation hold metadata and trailing bytes.

C✓ Tested
Bash ScriptsGetting Started

Count array elements

Bash Scripts: Count array elements with a small standalone Bash program.

Bash Scripts✓ Tested
Bash ScriptsArray operations

Count the elements in an array

Bash Scripts: The array length form counts assigned elements, not characters in the first value.

Bash Scripts✓ Tested
PythonGetting Started

Count the items in a collection

Python: Read the collection’s length instead of hard-coding the loop limit.

Python✓ Tested
C#Getting Started

Count the items in a collection

C#: Read the collection’s length instead of hard-coding the loop limit.

C#✓ Tested
JavaGetting Started

Count the items in a collection

Java: Read the collection’s length instead of hard-coding the loop limit.

Java✓ Tested