FIND YOUR NEXT FEW LINES

Results for “string_agg”

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

248 snippets foundClear filters
JavaText validation & formatting

Repeat text a fixed number of times

Java: Use String.repeat with a nonnegative repetition count.

Java✓ Tested
PostgresJSON & arrays

Replace a nested JSONB value

Change one path with jsonb_set.

jsonb_set✓ Tested
C#File operations & paths

Replace a path extension

C#: Path.ChangeExtension transforms a path string without moving or creating a file.

C#✓ Tested
JavaScriptStrings

Replace all literal matches

Replace repeated substrings with JavaScript replaceAll.

JavaScript✓ Tested
C#Strings

Replace literal text

Replace every literal occurrence in a C# string.

C#✓ Tested
JavaStrings

Replace literal text

Replace all literal matches in a Java string without regular expressions.

Java✓ Tested
Linux CommandsText processing

Replace text with sed

Replace all occurrences of the substring old on each line and print the transformed text without changing the input file.

sed✓ Tested
C++Strings

Replace the first match

Find and replace one literal substring in C++.

C++✓ Tested
JavaRecords & reliable control flow

Represent a finite set of states

Java: Use an enum to prevent arbitrary strings from representing application states.

Java✓ Tested
Bash ScriptsFunctions & arguments

Return text from a shell function

Capture a function’s output with command substitution.

function✓ Tested
PythonNumbers & calculations

Round decimal amounts explicitly

Python: Build Decimal values from strings and choose a rounding rule explicitly.

Python✓ Tested
PowerShellStructured formats & encodings

Serialize nested objects with an explicit depth

PowerShell: Select a sufficient depth so nested data is retained instead of converted into a descriptive string.

PowerShell✓ Tested