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

x/ddc_vim/deps.ts>fn.str2list

Dark deno-powered completion framework for neovim/Vim8
Go to Latest
function fn.str2list
import { fn } from "https://deno.land/x/ddc_vim@v3.8.0/deps.ts";
const { str2list } = fn;

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[]>