Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

1. Description

Allows manipulation of strings.

Info

This component is present in flow types like:

  • Voice;
  • Chat;
  • Forms;
  • Service.

The block (Fig.1(1)) is used in space to build the Flow. The settings panel for this component opens (Fig.1(2)) when you click on the block.

Fig.1. String component

1.1. String block

The block consists of the following elements:

  1. The name of the component;
  2. in branch - receiving (connecting with the previous block) branch;
  3. out branch - outgoing (connecting with the following block) branch.

1.2. String settings panel

It consists of the following elements:

  1. ;
  2. ;
  3. Method;
  4. ;

  5. Break;
  6. Add limit.

Here the name of the new variable is entered into which the result will be written.

Here you enter a variable with which you need to do manipulations.

1.2.3. Method

It is designed to select the method of manipulation. The following options are available:

  • length - return returns the length of the string;
  • indexOf - returns the index of the first occurrence of the entered value in the String object on which it was called. Returns -1 if the value is not found;
  • search - searches a string for the entered value and returns the position of the match. The search value can be a string or a regular expression. This method returns -1 if no match is found;
  • slice - extracts text from one line and returns a new string;
  • substring - similar to slice. The difference is that a substring cannot take negative indices;
  • substr - similar to slice. The difference is that the second parameter specifies the length of the extracted part;
  • replace - replaces the entered value with another value in the string;
  • toUpperCase - the string is converted to upper case;
  • charAt - returns the character at the specified index (position) in the string;
  • charCodeAt - returns the Unicode character at the specified index in the string;
  • split - a string can be converted to an array using the split function;
  • reverse - reverse the provided string;
  • base64 - base64 encoder/decoder;
  • MD5 - calculates a digest from a string using the MD5 algorithm;
  • SHA-256 - calculates a digest from a string using the SHA-256 algorithm;
  • SHA-512 - calculates a digest from a string using the SHA-512 algorithm;

Here you can enter an argument that is required for some methods.

1.2.5. Break

Include Page
Break
Break

1.2.6. Add limit

Include Page
Add limit
Add limit

Fig. 2. Setting a limit

Table of Contents