Function truncate

  • Truncates string

    Parameters

    • value: string
    • length: number
    • ending: string = '...'

    Returns string

    Example

    truncate('Hello world', 8)
    // Hello...