• Limit a String

    Parameters

    • input: string
    • length: number
    • end: string = '...'

    Returns string

    Example

    import { string } from "@rjweb/utils"

    string.limit('Hello sir', 5) // Hello...
    string.limit('Hello sir', 5, '!') // Hello!
    string.limit('OKay sir', 500) // OKay sir
    string.limit('Hi Sir', 3) // Hi...
    string.limit(' Ok ', 3) // Ok

    Since

    1.0.0

    Supports

    nodejs, browser

    Default

    end = '...'