Examples of use - Text steps

This is an example that shows how to use the following steps:

For this example, we create one string variable with value "this is demo variable". 

 

Get Text Length Step

 

First, we use the "Get Text Length Step" to determine how many characters our string variable has. 

After executing the process, our new variable "VariableLength" has value 21. 

Input and Output variables:

 

Pad Text Step

 

Now we will use "Pad Text Step" to add the character "A" to the end of a string variable that our variable is 30 characters long.

 

 

 

Our variable had length 21 ("this is demo variable"), so the step will add nine times the character "A" so the new variable after padding will be "this is demo variableAAAAAAAAA

Input and Output variables:

 

Replace Text Step

 

We will use "Replace Text Step" to replace the character "A" with space. So new value will be "this is demo variable         ". 

 

Input and Output variables:

 

Trim Text Step

 

To retrieve the original variable, we can use the "Trim Text Step" to remove any unnecessary added spaces. After executing this step, our variable returns to "this is demo variable".

 

Input and Output variables:

 

Index Of Text Step

 

Starting at position 0, the word "demo" appears at position 8. Using the "Index Of Text Step", we can retrieve this information in the variable IndexDemo.

 

 

Input and Output variables:

Get Subtext Step

 

Let's now use "Get Subtext Step" to get "demo" from our variable.  The word "demo" has 4 characters, so the length is 4. Now we are ready to populate the step.

After this step, our process will have a new variable named "SubText" and value "demo". 

Input and Output variables:

 

Append Line To Text Step

 

Now we will add "Append Line To Text Step"  to add text "demo" to our DemoVariable.

 

Input and Output variables:

Replace text Step (with regex)

 

Now, we will use the "Replace Text Step" again but with a regex expression to replace the new line with a space.

 

Input and Output variables:

 

Parse Text Step

 

DemoVariable now has the value "this is demo variable demo". Let's use the "Parse Text Step" to check how many times we have the text "demo" in our variable.

After process execution, our new variable, ParseCounter, has value 2 ( "this is demo variable demo") because the destination list variable with the name ListParse has two elements. This list indicates the position of the first character of the text to find, in our example "d" in "demo". 

 

 

Input and Output variables:

 

Split text step

 

We will split our variable using space as a delimiter. To do that, we will use "Split text step".

 

After process execution, our new variable SplitCounter has a value of 5 because the destination list variable with the name ListSplit has five elements. 

This list contains the following elements:

0. this

1. is

2. demo

3. variable

4. demo

Input and Output variables:

Contains Text Step

 

Our variable BooleanContains will have a value of "True" if DemoVariable contains the text "demo". This will be checked using the "Contains Text Step".

 

Input and Output variables:

To Upper Text Step 

 

We can use the "To Upper Text Step" function to get variable with uppercase letters. For example, we can change the value of the variable SubText from "demo" to "DEMO".

 

Input and Output variables:

 

To LowerText Step 

 

Using "To Lower Text Step" we can change it back from "DEMO" to "demo".

 

Input and Output variables:

 

To Title Case Text Step

 

If you want to capitalize only the first letter of each word and make all other letters lowercase, you can use the "To Title Case Text Step" function. After the process is complete, our variable will have the value "This Is Demo Variable Demo".

 

 

Input and Output variables:

 

Check variables values

If you want to view the values of your variables after process execution, you can check the process outputs by pressing Ctrl + 0 or clicking on the icon Process Output and choosing Variables.

 

Was this article helpful?