Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/rimbu/typical/str.ts>TakeStrict

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

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, "">