ReplaceText

public struct ReplaceText : Shortcut

Replaces some text with other text.

Input: Text

Result: Text

  • The contents of the shortcut.

    Declaration

    Swift

    public var body: some Shortcut { get }
  • Initializes the shortcut.

    Declaration

    Swift

    public init(text: Text, target: Text, replacement: Text, isCaseSensitive: Bool = true, isRegularExpression: Bool = false)

    Parameters

    text

    The text within which to search and replace.

    target

    The text to be replaced.

    replacement

    The text with which to replace all occurrences.

    isCaseSensitive

    When disabled, the capitalization of letters is ignored.

    isRegularExpression

    When enabled, the target is treated as a regular expression.

  • Initializes the shortcut.

    Declaration

    Swift

    public init(variable: Variable, target: Text, replacement: Text, isCaseSensitive: Bool = true, isRegularExpression: Bool = false)

    Parameters

    variable

    The variable in whose content to search and replace.

    target

    The text to be replaced.

    replacement

    The text with which to replace all occurrences.

    isCaseSensitive

    When disabled, the capitalization of letters is ignored.

    isRegularExpression

    When enabled, the target is treated as a regular expression.