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

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

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

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

Examples

Example 1

Drop<'abcd', 2> => 'cd'
Drop<'abcd', 5> => ''

Type Parameters

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