Skip to main content
Module

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

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

Returns the given string without the first N characters, or false if the string has less characters.

Examples

Example 1

DropStrict<'abcd', 2> => 'cd'
DropStrict<'abcd', 5> => false

Type Parameters

S extends string
N extends number
definition: N extends 0 ? S : S extends Append<string, infer Rest> ? DropStrict<Rest, Num.Decr<N>> : false