Skip to content

EditorState.sliceDoc method

EditorState › sliceDoc

Official

Return the given range of the document as a string.

Signature:

sliceDoc(from?: number, to?: number): string

Parameters:

ParameterTypeDescription
from?numberThe start position.
to?numberThe end position.

Returns: string — The document slice.