FIND YOUR NEXT FEW LINES

Results for “TRY_CONVERT”

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

247 snippets foundClear filters
PowerShellHashtables & object records

Use a fallback for a missing hashtable entry

PowerShell: Test the key explicitly so legitimate false or zero values are preserved.

PowerShell✓ Tested
SQL ServerTransactions & tables

Catch a T-SQL error

Handle an expected conversion error in TRY/CATCH.

TRY CATCH✓ Tested
GitBranches & ancestry

Count commits unique to each of two branches

Git: The symmetric difference with left-right separates commits reachable from only one side.

Git✓ Tested
GitBranches & ancestry

Create a branch from a known release tag

Git: A named starting revision makes the branch’s initial commit explicit.

Git✓ Tested
GitBranches & ancestry

Delete an already merged practice branch

Git: The lowercase -d option refuses to delete an unmerged branch in ordinary use.

Git✓ Tested
GitBranches & ancestry

Find branches that contain a selected commit

Git: branch --contains limits the list to branches whose histories include the chosen revision.

Git✓ Tested
PowerShellFunctions & control

Handle a terminating error

Catch conversion failures and produce a clear fallback.

try catch✓ Tested
C++Containers & compound values

Insert a map value only when a key is absent

C++: try_emplace preserves the old value when insertion does not take place.

C++✓ Tested
GitBranches & ancestry

Inspect a revision with detached HEAD

Git: Detached mode is useful for inspection; create a branch before keeping new work.

Git✓ Tested
GitBranches & ancestry

List branches already merged into the current branch

Git: The merged filter reports branches whose tips are reachable from HEAD.

Git✓ Tested
PowerShellDates & numeric validation

Parse an integer without throwing on invalid input

PowerShell: TryParse reports conversion success separately from its output value.

PowerShell✓ Tested
PowerShellText & data

Parse JSON into an object

Access a named field in a JSON document.

JSON✓ Tested