Skip to main content
Module

x/denops_std/function/mod.ts>list2str

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

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>