Files
remark42/frontend/app/utils/replaceSelection.ts
T
2019-04-28 19:27:36 +03:00

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]);
}