SheetXL - v0.3.20
    Preparing search index...
    • Trims a string to a specified maximum length and adds an ellipsis () if the string exceeds the limit.

      Parameters

      • str: string

        The string to trim.

      • maxLength: number = 36

        The maximum length of the string before truncation (default is 36).

      Returns string

      The truncated string with an ellipsis if it exceeds the specified length.

      clampString('This is a long string', 10); // Returns 'This is a …'