Strip
Function: Strip
This action helps you clean up text by removing any of a specified set of characters from both the beginning and the end of a larger piece of text. It's useful for tidying up data, removing unwanted leading or trailing symbols, or standardizing text formats.
Input
- Text: The main piece of text you want to modify. (Type: Text, Required)
- To strip: The specific characters you want to remove from the beginning and end of the main text. For example, if you enter
abc, any 'a', 'b', or 'c' found at the start or end of the text will be removed. (Type: Text, Required)
Output
- Result: The name of the variable where the cleaned-up text will be stored. By default, this will be stored in a variable named
RESULT. (Type: Text)
Execution Flow
Real-Life Examples
Example 1: Cleaning up product codes with delimiters Imagine you have product codes that sometimes come with extra characters like hyphens, underscores, or spaces at the beginning or end, and you want to standardize them.
- Inputs:
- Text:
---Product_XYZ--- - To strip:
- _(hyphen, space, underscore) - Result:
CleanedProductCode
- Text:
- Result: The variable
CleanedProductCodewill containProduct_XYZ. The hyphens, spaces, and underscores from theTo stripset were removed from both ends of the original text.
Example 2: Removing quotation marks and spaces from text You have text data that might be enclosed in single or double quotation marks, or have extra spaces, and you want to remove them for consistency.
- Inputs:
- Text:
"Hello World!" - To strip:
"'(double quote, single quote, space) - Result:
CleanedPhrase
- Text:
- Result: The variable
CleanedPhrasewill containHello World!. The leading/trailing spaces and double quotes were removed.
Example 3: Standardizing file names by removing leading/trailing numbers and symbols You're processing file names that might have leading/trailing numbers or special characters you want to remove to get to the core name.
- Inputs:
- Text:
123_MyDocument.pdf_456 - To strip:
0123456789_(all digits and underscore) - Result:
StandardFileName
- Text:
- Result: The variable
StandardFileNamewill containMyDocument.pdf. The leading123_and trailing_456were removed because their characters were present in theTo stripset.