Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "source/System/Text/Utility"

Index

Variables

EMPTY

EMPTY: string = ""

Functions

endsWith

  • endsWith(source: string, pattern: string): boolean
  • Returns true if the pattern matches the end of the source.

    Parameters

    • source: string
    • pattern: string

    Returns boolean

escapeRegExp

  • escapeRegExp(source: string): string
  • Escapes a RegExp sequence.

    Parameters

    • source: string

    Returns string

format

  • format(source: string, ...args: any[]): string
  • Takes any arg

    Parameters

    • source: string
    • Rest ...args: any[]

    Returns string

fromChars

  • fromChars(ch: number, count: number): string
  • fromChars(chars: number[]): string
  • Parameters

    • ch: number
    • count: number

    Returns string

  • Parameters

    • chars: number[]

    Returns string

getHashCode

  • getHashCode(source: string): number
  • Returns a numerical (integer) hash code of the string. Can be used for identifying inequality of contents, but two different strings in rare cases will have the same hash code.

    Parameters

    • source: string

    Returns number

repeat

  • repeat(source: string, count: number): string
  • Parameters

    • source: string
    • count: number

    Returns string

startsWith

  • startsWith(source: string, pattern: string): boolean
  • Returns true if the pattern matches the beginning of the source.

    Parameters

    • source: string
    • pattern: string

    Returns boolean

supplant

  • supplant(source: string, params: object | any[]): string
  • This takes a string and replaces '{string}' with the respected parameter. Also allows for passing an array in order to use '{n}' notation. Not limited to an array's indexes. For example, {length} is allowed. Based upon Crockford's supplant function.

    Parameters

    • source: string
    • params: object | any[]

    Returns string

trim

  • trim(source: string, chars?: string | string[], ignoreCase?: boolean): string
  • Can trim any character or set of characters from the ends of a string. Uses a Regex escapement to replace them with empty.

    Parameters

    • source: string
    • Optional chars: string | string[]

      A string or array of characters desired to be trimmed.

    • Optional ignoreCase: boolean

    Returns string

Generated using TypeDoc