Changes

m
no edit summary
Line 1: Line 1: −
This action can be used to perform basic string manipulation on a text string.<br/>
+
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
<br/>'''Substring'''<br/>
+
This action can be used to perform basic string manipulation on a text string.
 +
The replace text and extract text functions support the use of regex.
 +
</pre>
 +
 
 +
'''Substring'''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
Returns a sub-section of the text defined by the supplied start and end indexes. The first character starts at index 0 and the last index is excluded. (To get the first character use values 0 and 1.)
 
Returns a sub-section of the text defined by the supplied start and end indexes. The first character starts at index 0 and the last index is excluded. (To get the first character use values 0 and 1.)
<br/>'''Example Usage'''<br/>
  −
"hello i am using macrodroid app"<br/>
  −
To obtain the word Macrodroid we will use the initial position 17 and last position 27 and as a result we will have the value "Macrodroid".<br/>
  −
<br/>'''Replace all'''<br/>
  −
Uses a regular expression to replace matching text with the supplied new text.<br/>
  −
'''Example Usage'''<br/>
  −
Source text = Hello, how are you?.
  −
<br/>
  −
the text to replace is "hello".<br/>
  −
the new text is "hi"<br/>
  −
The end result will be, "hi, how are you?".
     −
<br/>'''Extract text'''<br/>
+
For example, in this string, 'hello I am using
Uses a regular expression to match and extract a section from the text.<br/>
+
the Macrodroid application', we can obtain the word 'Macrodroid' by using the initial position 17 and the last position 27.
<br/>'''Upper case'''<br/>
+
</pre>
Converts the text to all upper case characters.<br/>
+
 
<br/>'''Lower case'''<br/>
+
'''Replace all'''
Converts the text to all lower case characters.<br/>
+
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
<br/>'''Trim whitespase'''<br/>
+
The given function utilises a regular expression to substitute matching text with the provided new text.
 +
 
 +
For instance, if
 +
the source text is "Hello, how are you?"
 +
let's change the text "Hello" (text to replace)
 +
by new text "Hi" then the final output will be 'Hi, how are you?'
 +
</pre>
 +
 
 +
'''Extract text'''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
A regular expression can be used to match and extract specific sections of text.
 +
 
 +
For example, if the
 +
text contains a phone number
 +
such as 'My phone
 +
number is 1234567890', the expression '[0-9]' can be used to extract only the digits and obtain the phone number.
 +
</pre>
 +
 
 +
'''Upper case'''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
Converts the text to all uppercase letters.
 +
 
 +
Example of use
 +
Source text "Macrodroid is my application to automate my device".
 +
Output text
 +
"MACRODROID IS MY APP TO AUTOMATE MY DEVICE".
 +
</pre>
 +
 
 +
'''Lower case'''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
Converts the text to all lower case characters.
 +
 
 +
Example Usage
 +
Source text
 +
"MACRODROID IS MY APP TO AUTOMATE MY DEVICE".
 +
Output text
 +
"macrodroid is my app to automate my device".
 +
</pre>
 +
 
 +
'''Trim whitespace'''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
Removes any leading/trailing whitespace from the text.
 
Removes any leading/trailing whitespace from the text.
 +
 +
Example Usage
 +
 +
Source text
 +
"macrodroid is my app to automate my device".
 +
Output text
 +
"macrodroidismyapptoautomatemydevice".
 +
</pre>
 +
 +
'''Remove text'''
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
Remove text from some variable using plain text or Regex
 +
 +
Example Usage
 +
 +
Source text "MACRODROID IS MY APP TO AUTOMATE MY DEVICE".
 +
the text to remove is "MACRODROID".
 +
Output text
 +
" is my app to automate my device".
 +
</pre>
editors
1,599

edits