Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "string/limit"

Index

Functions

Functions

limit

  • limit(str: string, count: number): string
  • Limits the string to n character


    Example:

    import { limit } from "@thalesrc/js-utils/string";
    
    const str = 'foobarbaz';
    
    limit(str, 3); // 'foo'

    Prototype Example:

    import "@thalesrc/js-utils/string/proto/limit";
    
    const str = 'foobarbaz';
    
    str.limit(3); // 'foo'

    Parameters

    • str: string
    • count: number

      Count to limit string character size

    Returns string

    Limited string

Generated using TypeDoc