Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Strings/maxLength

Index

Functions

Functions

maxLength

  • maxLength(value: string, limit: number, ellipsis?: string): string
  • This helper is used to cut a string to a fixed number of characters. The resulting string will not exceed the given limit but will also respect word boundraries, not cutting words in half.

    By default ellipsis will be added at the end of a string which was cut. To disable this, set the third parameter to be an empty string

    Parameters

    • value: string

      The value to limit to a given number of characters

    • limit: number

      The number of characters

    • Optional ellipsis: string

      Optional: Used to override the ... added to a cut of string

    Returns string

Generated using TypeDoc