共用方式為


Srch.U.truncateEnd Method (DisplayTemplatesSrch)

Trims the given string based on the given cut off value; adding an ellipsis if required.

Srch.U.truncateEnd(original, maxChars)

Return value

The truncated result if the given string is longer than the cut off value; otherwise the same string will be returned.

Parameters

  • original
    The string to trim.

  • maxChars
    The maximum allowed length, after which the string will be trimmed.