Skip to main content
Module

x/rimbu/typical/mod.ts>Str.Last

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
type alias Str.Last
import { type Str } from "https://deno.land/x/rimbu@0.12.3/typical/mod.ts";
const { Last } = Str;

Returns the last character of the given string, or false if the string if empty.

Examples

Example 1

Last<'abcd'> => 'd'
Last<''> => false

Type Parameters

S extends string
definition: S extends Append<infer First, infer Rest> ? U.Extends<Rest, "", First, Last<Rest>> : false