Utility methods related to Strings.

Constructors

Methods

  • Iterates over the given string, line-by-line, looking for the given prefix. If found, returns the contents of the line after the prefix.

    Parameters

    • prefix: string
    • contents: string
    • errorOnUndefined: boolean = false

    Returns undefined | string

  • Equivalent to JS 'replace'.

    Parameters

    • string: string

      the string to process

    • oldSequence: string | RegExp

      the sequence we want to replace. To replace all occurrences, use a Regex with the 'g' modifier (e.g., //g). Regexes in string format automatically assumes the 'g' modifier.

    • newSequence: string

      the new value that will be used instead of the old value

    Returns string

    the string after the replacement is done

    Use the JS 'replace' method instead

  • Parameters

    • value: object

      The value to convert to Json.

    Returns string

    A string representing the given value in the Json format.

    Use the JS 'JSON.stringify' method instead