Replaces all text at positions corresponding to targets with text .
Parameters:
| Name | Type | Description |
|---|---|---|
| actionName | String | 'replaceTextByIndex' text replacing API |
| text | String | Text to replace |
| targets | Object[] | [{ id: {String}, startIndex: {Number}, endIndex: {Number} }, .....]
|
Example:
editor.execCommand('replaceTextByIndex', 'text', [
{ id: 'paragraphId1', startIndex: 0, endIndex: 3 },
{ id: 'paragraphId2', startIndex: 5, endIndex: 15 }
]); |