Function manyTillStr

  • manyTillStr is an optimized version of manyTill. The manyTill combinator is slow because it runs the given parser on every character of the string until it succeeds. However, if you just want to consume input until you get to a substring, use manyTillStr. It uses indexOf, which is significantly faster than running a parser over every character.

    Parameters

    • str: string

      the string to stop at

    • options: {
          insensitive?: boolean;
      } = {}

      object of optional parameters. { insensitive: boolean }

      • Optional insensitive?: boolean

    Returns Parser<string>

    a parser that consumes the input string until the given string is found.

Generated using TypeDoc