Remove Text Using Substrings
Removes a specific piece of text from a larger text.
Overview
This operation allows you to edit a text by specifying a piece of text ("a substring") to remove. You can optionally define the strategy to remove the substring's first, last, or all occurrences in the larger text.
Syntax
the text1 is "{text1 value}"
the text2 is "{text2 value}"
remove the text2 from the text1
Optional: Specifying a Remove Strategy
Optionally, you can specify a remove strategy using the where keyword. This specifies which occurrences of the second text to remove:
the text1 is "{text1 value}"
the text2 is "{text2 value}"
remove the text2 from the text1 where
the remove strategy is "{strategy}"
Data
The table below lists the names of the data elements in this operation and indicates which can be renamed in the syntax.
Data Name | Can Be Renamed |
---|---|
the text1 | Yes |
the text2 | Yes |
the remove strategy | No |
Parameters
Parameters are placeholders for data. Refer to the table below for details on each parameter in this operation. In the syntax, replace parameters with your own values.
Placeholder | Description | Examples | Required |
---|---|---|---|
| The target text. | "The dog barked." | Yes |
| The text to be removed from the target string. | "dog" | Yes |
| The removal strategy. There is no default. Accepted values:
| "all" | Optional |
Examples
1. Remove all occurrences
the input text is "The quick brown fox jumps over the lazy dog. The dog barked."
the focus word is "dog"
remove the focus word from the input text where
the remove strategy is "all"
The quick brown fox jumps over the lazy . The barked.
2. Remove the first occurrence
the input text is "The quick brown fox jumps over the lazy dog. The dog barked."
the focus word is "dog"
remove the focus word from the input text where
the remove strategy is "first"
The quick brown fox jumps over the lazy . The dog barked.
3. Remove the last occurrence
the input text is "The quick brown fox jumps over the lazy dog. The dog barked."
the focus word is "dog"
remove the focus word from the input text where
the remove strategy is "last"
The quick brown fox jumps over the lazy dog. The barked.
4. No removal strategy specified
the input text is "The quick brown fox jumps over the lazy dog. The dog barked."
the focus word is "dog"
remove the focus word from the input text
This will Raise a Question and prompt you to choose which value to remove.
Multiple: "dog"s in: "The quick brown fox jumps over the lazy dog. The dog barked." Which one do you want to remove?
Updated 30 days ago