Between indices
Function: Between indices
This function helps you extract a specific portion of text from a longer piece of text. You tell it where to start and where to end, and it will give you just that part. It's like cutting out a specific section from a sentence or a paragraph.
Input
- Text: The complete line of text from which you want to extract a smaller piece.
- Type:
STRING - Required: Yes
- Type:
- Start character index: The position of the very first character of the piece of text you want to extract. Remember that the first character in a text is usually at index 0.
- Type:
STRING(Enter a number, e.g.,5) - Required: Yes
- Type:
- End character index: The position of the character after the last character of the piece of text you want to extract. The character at this index will not be included in the result.
- Type:
STRING(Enter a number, e.g.,10) - Required: Yes
- Type:
Output
- Result: The name of the variable where the extracted piece of text will be stored. You can then use this variable in other parts of your application.
- Type:
STRING - Default Value:
RESULT
- Type:
Execution Flow
Real-Life Examples
Here are some ways you can use the "Between indices" function in your applications:
Example 1: Extracting a Product Code
Imagine you have a product ID string that includes a product code embedded within it.
- Inputs:
- Text:
"PROD-XYZ-12345-REGION" - Start character index:
5(to start after "PROD-") - End character index:
8(to end before "-12345-REGION") - Result:
ProductCode
- Text:
- Result: The variable
ProductCodewill contain"XYZ".
Example 2: Getting a Specific Part of a Date String
You have a date and time string and you only need the year.
- Inputs:
- Text:
"2023-10-26 14:30:00" - Start character index:
0(to start at the beginning) - End character index:
4(to end after the year "2023") - Result:
YearOnly
- Text:
- Result: The variable
YearOnlywill contain"2023".
Example 3: Isolating a Name from a Formatted String
You have a string with a user's full name formatted as "Lastname, Firstname" and you want to get just the first name.
- Inputs:
- Text:
"Doe, John" - Start character index:
5(to start after "Doe, ") - End character index:
9(to end after "John") - Result:
FirstName
- Text:
- Result: The variable
FirstNamewill contain"John".