String Operations

There are various string operation supported on PIM's dashboard

  • Concatenation Operator (concat)

  • Substring Operator(substring)

  • Length Operator(strLength)

  • Is Empty Operation( isEmpty )

  • Convert to integer ( toInt )

1. Concatenation Operator (concat)

To join multiple strings into a single string we use concatenation operator

Arguments

This operator will take upto 255 arguments

Example

concat("I ","Love ","Digia ");
// This will return "I Love Digia" as an output 

2. Substring Operator (substring)

If you want to find out substring from a string than you can use substring operator

Arguments

This operator will take two or three arguments (first 2 arguments are required)

Argument 1 : string from which you want to extract substring

Argument 2: starting index of substring (starting index is inclusive)

Argument 3: ending index of substring (ending index is exclusive)

Example

// Example 1
substring("Digia",1)
// output: igia
// If you only passes the starting index than it will return substring that will start from the starting index uptill the end of the string

//Example 2
substring("Digia",1,3)
// ouput: ig
// Note: start index in inclusive but end index is exclusive

3. Length Operator (strLength)

If you find out the length of the string than you can use length operator

Arguments

It will take one argument which is the string which you want to find out the length and it is the required argument

Example

strLength("Digia")
// Output: 5
// explanation: There are 5 characters in Digia string

4 . isEmpty

Checks if the given value is empty. Supports strings, lists, maps, and numbers

Argument

requires a string page state

isEmpty(var)
//var = " "
//it will return true as our page state is empty

5 . Toint

Converts a value to an integer. Supports strings and number

Example

toInt('10')
//will output 10

Last updated