ReplaceIn

Replaces a search string in the specified content with the content of input documents.
This is sort of like the inverse of the Replace module and is very useful for simple template substitution.

Usage

  • ReplaceIn(string search, ContextConfig content)

    Replaces all occurrences of the search string in the string value of the returned object with the content of each input document. This allows you to specify different content depending on the execution context.

    • search

      The string to search for.

    • content

      A delegate that returns the content within which to search for the search string.

  • ReplaceIn(string search, DocumentConfig content)

    Replaces all occurrences of the search string in the string value of the returned object with the content of each input document. This allows you to specify different content for each document depending on the input document.

    • search

      The string to search for.

    • content

      A delegate that returns the content within which to search for the search string.

  • ReplaceIn(string search, params IModule[] modules)

    The specified modules are executed against an empty initial document and all occurrences of the search string in the resulting document content are replaced by the content of each input document (possibly creating more than one output document for each input document).

    • search

      The string to search for.

    • modules

      Modules that output the content within which to search for the search string.

  • ReplaceIn(string search, Object content)

    Replaces all occurrences of the search string in the string value of the specified object with the content of each input document.

    • search

      The string to search for.

    • content

      The content within which to search for the search string.

Fluent Methods

Chain these methods together after the constructor to modify behavior.

  • IsRegex(RegexOptions regexOptions = 0)

    Indicates that the search string(s) should be treated as a regular expression(s) with the specified options.

    • regexOptions

      The options to use (if any).

GitHub