Tool-Shack
    Preparing search index...

    Function truncate

    • Truncate string to maximum given length if needed and append string at the end (by default "...")

      Parameters

      • value: string

        String value to be truncated

      • maxLength: number

        Maximum allowed length

      • appendedString: string = '...'

        String to append at the end, be default "..."

      Returns string

      Truncated value if needed otherwise original value