Skip to main content
Module

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

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

Returns the first N characters of the given string, or false if the string does not have enough characters.

Examples

Example 1

TakeStrict<'abcd', 2> => 'ab'
TakeStrict<'abcd', 5> => false

Type Parameters

S extends string
N extends number
definition: TakeStrictHelper<S, N, "">