Skip to main content

stringUtils

frontend


frontend / utils/stringUtils

utils/stringUtils

Functions

truncateLines()

truncateLines(str, options?): string

Defined in: utils/stringUtils.ts:8

Truncates a string to a specified number of lines with optional max length. Adds line breaks and an ellipsis if truncated.

Parameters

str

string

The string to truncate.

options?

Optional settings for lines and maxLength.

lines?

number

maxLength?

number

Returns

string

The truncated string with line breaks and ellipsis if applicable.