Function getLineStarting

  • Searches a multi-line string and returns the first line begining with the specified prefix. The prefix may be included with or omitted from the return string.

    Parameters

    • str: string

      The string to be searched.

    • prefix: string

      The string to locate at the beginning of a line.

    • includePrefix: boolean

      A flag indicating whether the prefix is to be included in the return value.

    Returns string | undefined

    The requested line or undefined if the prefix was not located.