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
CGetting Started

Measure a short text value

C: Read the length of an ASCII string. Non-ASCII text may use multiple code units or bytes depending on the language.

C✓ 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
jQueryEvents

Mirror input text

Update a result as the user types using a jQuery input event.

jQuery✓ Tested
HTMLImages & embedded documents

Name a meaningful image with alternative text

HTML: Alt supplies an accessible text alternative describing the image’s purpose.

HTML✓ Tested
GoConcurrency & cancellation

Observe context cancellation

Observe context cancellation using a complete Go program with explicit sample inputs.

Go✓ Tested
HTMLMetadata & document links

Offer a downloadable text file

HTML: The download attribute supplies a filename for this same-document data URL.

HTML✓ Tested
ReactContext & shared state

Override context in a nested section

Override context in a nested section with a small React component and explicit browser behavior.

React✓ Tested
CNumbers & memory

Parse an integer with validation

Validate range and trailing characters when parsing a C integer with strtol.

C✓ Tested
JavaScriptObjects & JSON

Parse JSON text

Read a JavaScript object from JSON text.

JavaScript✓ Tested
Arduino / CGetting Started

Print a fixed text buffer

Arduino / C: Print a fixed text buffer on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
Bash ScriptsText parsing & arithmetic

Print text containing percent characters literally

Bash Scripts: Never use untrusted text as the printf format string.

Bash Scripts✓ Tested
JavaFile operations & binary data

Process a text file one line at a time

Java: Use a buffered reader to avoid loading a large file into memory.

Java✓ Tested