Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface StringConstructor

Extends the built-in javascript String object's static API. The StringConstructor.format method exposes the core logic of the project.

The Format.Config.addUtilsToGlobals method must be called in order to access any additional definitions.

Hierarchy

  • StringConstructor

Index

Methods

format

  • format(format: string, ...args: Object[]): string
  • format(provider: FormatProvider, format: string, ...args: Object[]): string
  • Converts the value of objects to strings based on the formats specified and inserts them into another string.

    Parameters

    Returns string

    A copy of the format string in which the format items have been replaced by the string representation of the corresponding objects in args.

  • Converts the value of objects to strings based on the formats specified and inserts them into another string.

    Parameters

    Returns string

    A copy of the format string in which the format items have been replaced by the string representation of the corresponding objects in args.

insert

  • insert(value: string, startIndex: number, insertValue: string): string
  • Returns a new string in which a specified string is inserted at a specified index position in the value instance.

    Must call Format.Config.addUtilsToGlobals to be defined.

    Parameters

    • value: string

      The string into which to insert.

    • startIndex: number

      The zero-based index position of the insertion.

    • insertValue: string

      The string to insert.

    Returns string

    A new string that is equivalent to the value instance, but with insertValue inserted at position startIndex.

isNullOrWhitespace

  • isNullOrWhitespace(value: string): boolean
  • Indicates whether the specified string is undefined, null, "", or consists only of white-space characters.

    Must call Format.Config.addUtilsToGlobals to be defined.

    Parameters

    • value: string

      The string to test.

    Returns boolean

    true if the value parameter is undefined, null, "", or if value consists exclusively of white-space characters.

Generated using TypeDoc