truncateAppendEnding

Truncate the length of a UTF-8 string and append a set ending. The string is initially truncated so that it is of maximum length n (this includes the extra ending paramter so the string is truncated to position n - ending.length).

truncateAppendEnding
(,
size_t n
,
cstring ending = "..."
)

Parameters

str mstring

string to truncate and append the ending to

n size_t

maximum number of code points in the resulting string

ending cstring

the ending to append to the string, defaults to "..."

In: n must be at least ending.length

Return Value

Type: mstring

The truncated and appended string for method chaining

Meta