shortenName

fun CharSequence.shortenName(width: Int = DEFAULT_MAX_WIDTH): CharSequence

Shortens the given name if it exceeds the specified width.

Return

The shortened name if it exceeds the width, otherwise the original name.

Parameters

this

@shortenName The name to be shortened.

width

The maximum width of the shortened name; must be at least 5. Defaults to 20.