Search Docs
insertAfter
在 input 字符串中指定的 target 之后插入 insertText。
input
target
insertText
import { insertAfter } from 'funtool'; insertAfter('hello', 'X', 1); // ✅ 'heXllo' insertAfter('foo-bar', '_', '-'); // ✅ 'foo-_bar' insertAfter('abc', '_', 'z'); // ❌ 'abc'
function insertAfter(input: string, insertText: string, target: string | number): string
string
target (