FIND YOUR NEXT FEW LINES

Results for “tr”

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

1534 snippets foundClear filters
C#Text validation & encoding

Build text incrementally with StringBuilder

C#: Append fragments instead of repeatedly concatenating intermediate strings in a loop.

C#✓ Tested
CSmall algorithms & bit operations

Calculate an average without integer division truncation

C: Accumulate into double and divide by the nonzero number of readings.

C✓ Tested
JavaStream transformations

Calculate several numeric stream statistics

Java: Use summaryStatistics to calculate count, sum, minimum, maximum, and average in one pass.

Java✓ Tested
PowerShellCommands & execution context

Capture a command’s success-stream output

PowerShell: Assignment collects output values without requiring text redirection to a file.

PowerShell✓ Tested
AngularServices & dependency injection

Centralize a reusable validation rule

Centralize a reusable validation rule with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactState & reducers

Centralize state changes in a reducer

Centralize state changes in a reducer with a small React component and explicit browser behavior.

React✓ Tested
CSSInteraction selectors

Change a control’s appearance on hover

CSS: Hover applies while a pointing device is positioned over the element.

CSS✓ Tested
CStrings & byte buffers

Check a literal string prefix

C: strncmp compares at most the prefix length; both inputs must be valid strings.

C✓ Tested
JavaText validation & formatting

Check a string prefix

Java: Use startsWith to check a literal Java prefix without a regular expression.

Java✓ Tested
PowerShellStrings & literal text

Check a string prefix using ordinal comparison

PowerShell: Supply an explicit comparison rule for protocol identifiers.

PowerShell✓ Tested
JavaStream transformations

Check any and all stream elements

Java: Use short-circuiting match operations for predicates over a Java collection.

Java✓ Tested
JavaScriptStrings

Check for a substring

Perform a case-sensitive JavaScript substring check.

JavaScript✓ Tested