extract
Description
Extract a specific length of characters from a string of text.
Input / Parameter
type
The part of the string to extract characters from.
Text
-
Left , Middle , Right
Yes
text
The string of text to extract from.
Text
-
-
Yes
length
The length of characters to extract.
Number
-
-
Yes
start
The index to start extracting from.
Number
-
-
Yes (Applicable for type ‘Middle’ only.)
Output
Returns the extracted string of text.
String/Text
Example
In this example, we will extract a part of a text using extract function.
Steps
Drag a
button
component into the canvas and open theAction
tab. Select thepress
event of the button.Add
Log.write
function and add a subflow on it's value, then putText.extract
inside it and fill type param withLeft
and the text param withHello, 世界🌍!
and length param with5
.Add
Log.write
function and add a subflow on it's value, then putText.extract
inside it and fill type param withRight
and the text param withHello, 世界🌍!
and length param with6
.Add
Log.write
function and add a subflow on it's value, then putText.extract
inside it and fill type param withMiddle
and the text param withHello, 世界🌍!
and length param with5
and start param with7
.
Result
The console on preview will show us the formatted text value
Hello
,世界🌍!
&世界🌍!
.
Links
Related Information
Last updated