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

x/rimbu/typical/str.ts>Take

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

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

Examples

Example 1

Take<'abcd', 2> => 'ab'
Take<'abcd', 5> => 'abcd'

Type Parameters

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