Truncates a string and adds an ellipsis at the specified position if it exceeds the maximum length.
The input string to be truncated.
The maximum allowed length of the string including the ellipsis.
Optional
Options to customize the ellipsis behavior.
The truncated string with ellipsis if needed.
Truncates a string and adds an ellipsis at the specified position if it exceeds the maximum length.