Files
remark42/web/app/utils/replaceSelection.ts
T

4 lines
190 B
TypeScript

export function replaceSelection(text: string, selection: [number, number], replacement: string): string {
return text.substr(0, selection[0]) + replacement + text.substr(selection[1]);
}