Skip to main content

abbr

Abbreviate word.

def abbr(
S: str,
max: int,
ellipsis: str | bool = '...'
) - > str

Abbreviate word.

Parameters

NameTypeDescription
SstrThe input string to be shortened.
maxintThe maximum allowed length of the resulting string, including the ellipsis.
ellipsis`strbool` = '...'

Returns

TypeDescription
strThe abbreviated string if the length exceeds the maximum, otherwise the original string or a placeholder for null values.