Manipulate some text
Last updated
Was this helpful?
Last updated
Was this helpful?
With the 'Manipulate some text' block you are able to provide a text and perform text operations like getting the length of the text, trimming text or checking if the text starts or ends with another string.
The text to perform manipulations on. All Variables can be used in this field.
The type of text manipulation to perform on the provided Text string. There are several operations to choose from. Below you can find detailed information about each operation and how it can be used.
Returns the number of characters in the string.
Returns the character at the position of the specified index in the string.
Returns the index position of the first appearance of a specified query in the string.
Returns the index position of the last appearance of a specified query in the string.
The Get Length operation allows you to return the number of characters of the text provided.
Hello World!
12
BotGhost
8
The Character At operation returns the character at the specified index.
The position of the character in the string that you'd like to return. Indexes start at 0. All Variables can be used in this input.
Hello World!
0
H
Hello World!
1
e
Hello World!
7
o
BotGhost
4
h
The Index Of operation returns the index of the first character of the given portion of text. If there are multiple matches, the first match is returned. If there are no matches, -1
is returned.
The text to find the index of. This input is case sensitive. All Variables can be used in this input.
Hello World!
e
1
Hello World!
World
6
Hello World!
BotGhost
-1
yes, goodbye
ye
0
The Last Index Of operation returns the index of the first character of the given portion of text. If there are multiple matches, the last match is returned. If there are no matches, -1
is returned.
The text to find the last index of. This input is case sensitive. All Variables can be used in this input.
Hello World!
o
7
Hello World!
Hello
0
Hello World!
BotGhost
-1
BotGhost is cool, isn't it?
is
18
You can see a list of string methods in the action, or .
The Substring operation allows you to extract text between the start and end indexes. It works similarly to the Slice operation. You can learn more about the differences between the Slice and Substring operations .
The Slice operation allows you to extract text between the start and end indexes. It works similarly to the Substring operation. You can learn more about the differences between the Slice and Substring operations .
Regular expressions can be a tricky concept and take practice. Before using this operation, it's advised to check out other resources like and to learn more and experiment with regular expressions. You can also use the ChatGPT module or other AI websites to generate regex patterns for you, but they may not always be accurate.
Regular expressions can be a tricky concept and take practice. Before using this operation, it's advised to check out other resources like and to learn more and experiment with regular expressions. You can also use the ChatGPT module or other AI websites to generate regex patterns for you, but they may not always be accurate.
The Variable field allows you to name the variable that can be used in other Actions and Conditions that follow this action block in the same . You can use the clipboard icon under Result Variable to copy this variable to your device's clipboard.