Get truncated text ending with ellipsis if the text is longer than the specified length
getTruncatedContent('This is a long string', 10) // 'This is a...' Copy
getTruncatedContent('This is a long string', 10) // 'This is a...'
The string to truncate
The length of the final string
An excerpt of the truncated text with ellipsis
Get truncated text ending with ellipsis if the text is longer than the specified length
Example