@akashrajpurohit/utils
    Preparing search index...

    Function getTruncatedContent

    • Get truncated text ending with ellipsis if the text is longer than the specified length

      Parameters

      • content: undefined | null | string

        The string to truncate

      • length: number = 250

        The length of the final string

      Returns null | string

      An excerpt of the truncated text with ellipsis

      getTruncatedContent('This is a long string', 10) // 'This is a...'