EU Parliament Monitor — API Documentation - v0.9.24
    Preparing search index...
    • Replace the first literal occurrence of needle in haystack with replacement. Uses indexOf rather than String.prototype.replace with a regex so we don't fall foul of the security/detect-unsafe-regex lint rule, and so we never accidentally interpret regex metacharacters inside needle or $1-style references inside replacement.

      Parameters

      • haystack: string

        String to search in

      • needle: string

        Literal substring to replace

      • replacement: string

        Literal replacement text (no $ escaping needed)

      Returns string

      Modified string, or haystack unchanged when needle is absent