- 13 Feb 2023
- 3 Minutes to read
- Contributors
- Print
- DarkLight
- PDF
Text Component
- Updated on 13 Feb 2023
- 3 Minutes to read
- Contributors
- Print
- DarkLight
- PDF
The Text component consists of blocks that perform operations related to texts. They are as follows:
Text
The Text block can have a text or number within quotes(''). This is used to represent a string.
Input | Output | Block Layout | Generated Code |
---|---|---|---|
Text or Number | Text |
|
Comment
This block adds a piece of comment in the code script.
Input | Output | Block Layout | Generated Code |
---|---|---|---|
Text or Number | Text |
|
Create Texts from Multiple Texts
This block combines two or more texts to return a new text. It is similar to string concatenation where two or more texts are joined to form a new text. It can be done using independent variables or arrays.
Input | Output | Block Layout | Generated Code |
---|---|---|---|
Variable or text or number for all of the input values | Text |
|
Convert Text to Upper Case, Lower Case or Title Case
This block converts a string value to UPPER CASE, lower case or Title Case based on selection.
Input | Output | Block Layout | Generated Code |
---|---|---|---|
Variable or text Choose the type of text operation from the dropdown list | Text |
|
Length
This block takes a particular text input (String) and provides the length of the text as output. The length is displayed as an integer.
Input | Output | Block Layout | Generated Code |
---|---|---|---|
Text or variable | Length of text as integer |
|
Append Text
This block is used to append a text value to the declared variables.
Input | Output | Block Layout | Generated Code |
---|---|---|---|
For input-1: Choose variable from dropdown list For input-2: Add Variable block or Text | Append text value to the variable |
|
Find First or Last Occurrence of Text
This block finds the first or last occurrence of a piece of text in a given variable with the help of the text index. The search is done either on the top-down approach or vice-versa. By identifying the index value, the text location is identified and displayed in the output.
Input | Output | Block Layout | Generated Code |
---|---|---|---|
For input-1: Choose a variable from the dropdown list Choose the operation from the dropdown list For input -2: Text or variable | Number |
|
Get Char
This block fetches a particular character or letter (letter #, letter # from end, first letter, last letter, random letter) for a string input. This block also finds the letter with the help of indexing.
Input | Output | Block Layout | Generated Code |
---|---|---|---|
Variable or Text for input-1 Choose the search index type (# - index from the top, # from end - index from the bottom, first letter, last letter and random letter). Variable or number for input-2 | Returns character from given input-1 text for the given input-2 index. |
|
Print to Console
This block is used to print a particular variable to the browser console log. The variable can be either a text or a number declared as a string.
Input | Output | Block Layout | Generated Code |
---|---|---|---|
Variable or Text or Number | Print the value to console output. |
|
This block is used to print a particular text in an alert window in the UI. The input can either be a text or a number declared as a string.
Input | Output | Block Layout | Generated Code |
---|---|---|---|
Variable or Text or Number | Print the value to the popup window. |
|
Trim
This block trims white spaces before, after and in between texts.
Input | Output | Block Layout | Generated Code |
---|---|---|---|
Variable or Text, Choose the trim type (both sides - trim both sides white space, left side - trim only left side white space and right side trim only right side white space). | Returns text with white space trimmed. |
|
Variable Functions
The Variable Functions command the return values based on user requests. They return: character location, character code location, concatenated values, includes, index values, last index values, local comparison values and many other values.
Input | Output | Block Layout | Generated Code |
---|---|---|---|
Choose the type of function Variable or Text or number for all input fields | Returns Text or Character |
|
|
Subtext
This block is used to fetch a particular piece of text from the whole text(string). The inputs are given and the output is a character based on all the inputs.
Input | Output | Block Layout | Generated Code |
---|---|---|---|
Variable or Text for input-1 Variable or number for input-2 and input- 3 | Returns the Text from input-1 based on input-2 and input-3. |
|