FIND YOUR NEXT FEW LINES

Results for “return”

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

139 snippets foundClear filters
CStrings & byte buffers

Find the first occurrence of a character

C: strchr returns a pointer into the input or NULL if the character is absent.

C✓ Tested
C++Sequence algorithms

Find the first value satisfying a condition

C++: Compare the returned iterator with end before dereferencing it.

C++✓ Tested
PowerShellArray operations

Find the index of an array item

PowerShell: Array.IndexOf returns -1 when the requested item is absent.

PowerShell✓ Tested
C++Ordering & set operations

Find the insertion position for a sorted value

C++: lower_bound returns the first position whose value is not less than the search key.

C++✓ Tested
JavaScriptArray traversal & selection

Find the position of a matching item

JavaScript: findIndex returns -1 when the predicate matches nothing.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Find the position of a matching item

TypeScript: findIndex returns -1 when the predicate matches nothing.

TypeScript✓ Tested
C#Collections & data structures

Find values common to two collections

C#: Intersect returns distinct values shared by the inputs.

C#✓ Tested
Arduino / CSerial protocols

Handle incomplete serial input

Arduino / C: The returned byte count distinguishes a complete payload from a timed-out partial one.

Arduino / C✓ Tested
PowerShellStrings & literal text

Join several strings with a separator

PowerShell: The join operator returns one string from an input collection.

PowerShell✓ Tested
PowerShellFiles & paths

List files by extension

Enumerate regular files and return their names in order.

Get-ChildItem✓ Tested
JavaFile operations & binary data

Move a file to a new name

Java: Files.move changes the path and returns the destination Path.

Java✓ Tested
C#Asynchronous work & URI handling

Parse a GUID without an exception

C#: TryParse reports malformed values with a boolean return.

C#✓ Tested