Results for “file count”
Small, practical examples. Search by task or narrow things down below.
Count the items in a collection
Java: Read the collection’s length instead of hard-coding the loop limit.
Java✓ Tested
Count the items in a collection
JavaScript: Read the collection’s length instead of hard-coding the loop limit.
JavaScript✓ Tested
Count the items in a collection
TypeScript: Read the collection’s length instead of hard-coding the loop limit.
TypeScript✓ Tested
Count the items in a collection
C++: Read the collection’s length instead of hard-coding the loop limit.
C++✓ Tested
Count the items in a collection
C: Read the collection’s length instead of hard-coding the loop limit.
C✓ Tested
Count the rows in a table
SQL: COUNT(*) includes every row, including rows with NULL columns.
SQL✓ Tested
Count the rows in a table
SQL Server: COUNT(*) includes every row, including rows with NULL columns.
SQL Server✓ Tested
Count the rows in a table
Postgres: COUNT(*) includes every row, including rows with NULL columns.
Postgres✓ Tested
Count the rows in a table
SQLite: COUNT(*) includes every row, including rows with NULL columns.
SQLite✓ Tested
Count Unicode code points
Java: Use codePointCount when supplementary characters should count as one rather than two UTF-16 units.
Java✓ Tested
Count Unicode code points in a string
JavaScript: String iteration combines surrogate pairs, unlike the UTF-16 length property.
JavaScript✓ Tested
Count Unicode code points in a string
TypeScript: String iteration combines surrogate pairs, unlike the UTF-16 length property.
TypeScript✓ Tested