• Truncates string if it’s longer than the given maximum string length. The last characters of the truncated string are replaced with the omission string which defaults to "…".

    Parameters

    • Optionalstring: string

      The string to truncate.

    • Optionaloptions: TruncateOptions

      The options object or maximum string length.

    Returns string

    Returns the truncated string.