Skip to main content
Module

x/ddc_vim/deps.ts>fn.tr

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

The result is a copy of the {src} string with all characters which appear in {fromstr} replaced by the character in that position in the {tostr} string. Thus the first character in {fromstr} is translated into the first character in {tostr} and so on. Exactly like the unix "tr" command. This code also deals with multibyte characters properly. Examples: echo tr("hello there", "ht", "HT") returns "Hello THere" echo tr("", "<>", "{}") returns "{blob}" Can also be used as a |method|: GetText()->tr(from, to)

Parameters

denops: Denops
src: unknown
fromstr: unknown
tostr: unknown

Returns

Promise<unknown>