Last characters
Function: Last characters
This action helps you extract a specific number of characters from the very end of any text. It's useful when you need to grab the last part of a string, like a file extension, the last few digits of a code, or the end of a sentence.
Input
- Text: (STRING) The original piece of text from which you want to extract characters. This input is required.
- Amount of characters: (NUMBER) The exact number of characters you wish to retrieve, counting from the end of the text. This input is required.
Output
- Result: (STRING) This is the name of the variable where the extracted characters will be stored. By default, this variable is named "RESULT", but you can specify a different name if needed.
Execution Flow
Real-Life Examples
Here are some practical ways you can use the "Last characters" action in your applications:
-
Extracting a File Extension: Imagine you have a list of filenames and you need to identify their file types (e.g., ".pdf", ".jpg").
- Inputs:
- Text: "report_q3_2023.pdf"
- Amount of characters: 4
- Result: The action extracts ".pdf" and stores it in the "RESULT" variable.
- Inputs:
-
Getting the Last Digits of an Order ID: Suppose your order IDs are structured with a unique identifier at the end, and you only need those last few digits for a specific process.
- Inputs:
- Text: "ORD-2023-001-45678"
- Amount of characters: 5
- Result: The action extracts "45678" and stores it in the "RESULT" variable.
- Inputs:
-
Retrieving the Last Part of a Product Code: If your product codes include a variant identifier at the end, you can easily isolate it.
- Inputs:
- Text: "PROD-XYZ-BLUE-L"
- Amount of characters: 2
- Result: The action extracts "-L" and stores it in the "RESULT" variable.
- Inputs: