Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FormattedString

Represent a translatable formatted string

export

Hierarchy

  • FormattedString

Index

Constructors

constructor

  • Creates an instance of FormattedString.

    memberof

    FormattedString

    Parameters

    • fs: string

      format string

    • args: any[]

      input values of the format patterns

    Returns FormattedString

Properties

fs

fs: string

Format string in the following form

"format string with {0} and {1}"
// {[0-9]} is the format pattern
memberof

FormattedString

values

values: any[]

The value of the format pattern represented in fs

memberof

FormattedString

Methods

__

  • __(): string
  • Translate the format string to the current system locale language, format the string with values and then converted it to normal string

    memberof

    FormattedString

    Returns string

asBase64

  • asBase64(): string
  • Convert the formatted string to Base^$

    memberof

    FormattedString

    Returns string

asUint8Array

  • asUint8Array(): Uint8Array
  • Convert the formatted string to uint8 array

    memberof

    FormattedString

    Returns Uint8Array

escape

  • escape(): string
  • Escape the formatted string

    memberof

    FormattedString

    Returns string

format

  • format(...args: any[]): void
  • Input values for the format string

    memberof

    FormattedString

    Parameters

    • Rest ...args: any[]

    Returns void

hash

  • hash(): number
  • Return the hash number of the formatted string

    memberof

    FormattedString

    Returns number

match

  • match(t: string | RegExp): RegExpMatchArray
  • Match the formatted string against a regular expression a string pattern

    memberof

    FormattedString

    Parameters

    • t: string | RegExp

      string or regular expression

    Returns RegExpMatchArray

toString

  • toString(): string
  • Convert FormattedString to String

    memberof

    FormattedString

    Returns string

unescape

  • unescape(): string
  • Un escape the formatted string

    memberof

    FormattedString

    Returns string