FIND YOUR NEXT FEW LINES

Results for “last”

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

26 snippets foundClear filters
JavaScriptText handling & Unicode

Extract the text after the last delimiter

JavaScript: Use lastIndexOf when earlier occurrences should remain part of the prefix.

JavaScript✓ Tested
TypeScriptText handling & Unicode

Extract the text after the last delimiter

TypeScript: Use lastIndexOf when earlier occurrences should remain part of the prefix.

TypeScript✓ Tested
JavaDates & time zones

Find the last day of a month

Java: Use YearMonth so leap years and month lengths are handled by the calendar library.

Java✓ Tested
Bash ScriptsLoops & decisions

Read a file without losing its last line

Handle spaces, backslashes, and a final line without a newline.

read lines✓ Tested
PowerShellArray operations

Read the last array element

PowerShell: A negative array index counts backward from the end.

PowerShell✓ Tested
SQLWindow analytics

Read the last value of the complete partition

SQL: Specify an unbounded-following frame so LAST_VALUE does not stop at the current row.

SQL✓ Tested
SQL ServerWindow analytics

Read the last value of the complete partition

SQL Server: Specify an unbounded-following frame so LAST_VALUE does not stop at the current row.

SQL Server✓ Tested
PostgresWindow analytics

Read the last value of the complete partition

Postgres: Specify an unbounded-following frame so LAST_VALUE does not stop at the current row.

Postgres✓ Tested
SQLiteWindow analytics

Read the last value of the complete partition

SQLite: Specify an unbounded-following frame so LAST_VALUE does not stop at the current row.

SQLite✓ Tested
AngularLists & control flow

Style the first and last list items

Style the first and last list items with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
C#Collections & data structures

Use a last-in first-out stack

C#: Stack is useful for reversible traversal and other nested operations.

C#✓ Tested
C++Containers & compound values

Use a last-in first-out stack

C++: Read top before pop because pop does not return the removed value.

C++✓ Tested