Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ddu_vim/deps.ts>fn.list2str

Dark deno-powered UI framework for neovim/Vim
Very Popular
Go to Latest
function fn.list2str
import { fn } from "https://deno.land/x/ddu_vim@v4.0.0/deps.ts";
const { list2str } = fn;

Convert each number in {list} to a character string can concatenate them all. Examples:

list2str([32])          returns " "
list2str([65, 66, 67])  returns "ABC"

The same can be done (slowly) with:

join(map(list, {nr, val -> nr2char(val)}), '')

str2list() does the opposite.

When {utf8} is omitted or zero, the current 'encoding' is used. When {utf8} is TRUE, always return UTF-8 characters. With UTF-8 composing characters work as expected:

list2str([97, 769])     returns "á"

Returns an empty string on error.

Can also be used as a method:

GetList()->list2str()

Parameters

denops: Denops
list: unknown
optional
utf8: unknown

Returns

Promise<string>