SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Function clampString

    • 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 …'