Skip to main content
Module

x/denops_std/function/vim/mod.ts>slice

📚 Standard module for denops.vim
Go to Latest
function slice
import { slice } from "https://deno.land/x/denops_std@v6.4.0/function/vim/mod.ts";

Similar to using a slice "expr[start : end]", but "end" is used exclusive. And for a string the indexes are used as character indexes instead of byte indexes, like in vim9script. Also, composing characters are not counted. When {end} is omitted the slice continues to the last item. When {end} is -1 the last item is omitted. Returns an empty value if {start} or {end} are invalid.

Can also be used as a method:

GetList()->slice(offset)

Parameters

denops: Denops
expr: unknown
start: unknown
optional
end: unknown

Returns

Promise<string | unknown[] | unknown>