Skip to main content
Module

x/denops_std/function/mod.ts>strchars

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

The result is a Number, which is the number of characters in String {expr}. When {skipcc} is omitted or zero, composing characters are counted separately. When {skipcc} set to 1, Composing characters are ignored. |strcharlen()| always does this. Also see |strlen()|, |strdisplaywidth()| and |strwidth()|. {skipcc} is only available after 7.4.755. For backward compatibility, you can define a wrapper function: if has("patch-7.4.755") function s:strchars(str, skipcc) return strchars(a:str, a:skipcc) endfunction else function s:strchars(str, skipcc) if a:skipcc return strlen(substitute(a:str, ".", "x", "g")) else return strchars(a:str) endif endfunction endif Can also be used as a |method|: GetText()->strchars()

Parameters

denops: Denops
expr: unknown
optional
skipcc: unknown

Returns

Promise<unknown>