Skip to main content
Module

x/denops_std/function/mod.ts>str2list

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

Return a list containing the number values which represent each character in String {string}. Examples:

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

list2str() does the opposite.

When {utf8} is omitted or zero, the current 'encoding' is used. When {utf8} is TRUE, always treat the String as UTF-8 characters. With UTF-8 composing characters are handled properly:

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

Can also be used as a method:

GetString()->str2list()

Parameters

denops: Denops
string: unknown
optional
utf8: unknown

Returns

Promise<unknown[]>