Skip to main content

core.wordwrap

Home > @medplum/core > wordWrap

wordWrap() function

Returns a word-wrapped string. Based on: https://stackoverflow.com/a/38709683

Signature:

export declare function wordWrap(text: string, maxLength: number): string[];

Parameters

Parameter

Type

Description

text

string

Original input string.

maxLength

number

Width in number of characters.

Returns:

string[]

Array of lines.