FIND YOUR NEXT FEW LINES

Results for “Text validation & formatting”

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

939 snippets foundClear filters
JavaScriptObjects & JSON

Serialize an object

Turn a JavaScript object into JSON text.

JavaScript✓ Tested
C#Data & dates

Serialize an object to JSON

Serialize a small anonymous C# object with System.Text.Json.

C#✓ Tested
SQL ServerJSON & results

Serialize query rows as JSON

Return a JSON array directly from a SELECT.

FOR JSON✓ Tested
jQueryText & attributes

Set a form field value

Populate a labeled input with jQuery val.

jQuery✓ Tested
jQueryText & attributes

Set an element attribute

Update an HTML link using jQuery attr.

jQuery✓ Tested
SQLWindow analytics

Show a group total beside each detail row

SQL: A partitioned aggregate preserves detail rows instead of collapsing them with GROUP BY.

SQL✓ Tested
SQL ServerWindow analytics

Show a group total beside each detail row

SQL Server: A partitioned aggregate preserves detail rows instead of collapsing them with GROUP BY.

SQL Server✓ Tested
PostgresWindow analytics

Show a group total beside each detail row

Postgres: A partitioned aggregate preserves detail rows instead of collapsing them with GROUP BY.

Postgres✓ Tested
SQLiteWindow analytics

Show a group total beside each detail row

SQLite: A partitioned aggregate preserves detail rows instead of collapsing them with GROUP BY.

SQLite✓ Tested
Linux CommandsText processing

Show the first lines of a file

Read only the first three lines of a text file, useful for checking a header or previewing a large log.

head✓ Tested
Linux CommandsText processing

Sort and deduplicate lines

Sort lines alphabetically and remove duplicate lines in a predictable C locale.

sort✓ Tested
SQLSubqueries & ranked selection

Sort preferred rows ahead of other rows

SQL: A CASE ordering key expresses business priority before a stable secondary sort.

SQL✓ Tested