# extract

## Description

Extract a specific length of characters from a string of text.

## Input / Parameter

| Name   | Description                                        | Input Type | Default | Options               | Required                                 |
| ------ | -------------------------------------------------- | ---------- | ------- | --------------------- | ---------------------------------------- |
| 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

| Description                           | Output Type |
| ------------------------------------- | ----------- |
| Returns the extracted string of text. | String/Text |

## Example

In this example, we will extract a part of a text using extract function.

### Steps

1. Drag a `button` component into the canvas and open the `Action` tab. Select the `press` event of the button.
2. Add `Log.write` function and add a subflow on it's value, then put `Text.extract` inside it and fill type param with `Left` and the text param with `Hello, 世界🌍!` and length param with `5`.

   ![](/files/sEVf9NvG0QaBEd7TGufW)
3. Add `Log.write` function and add a subflow on it's value, then put `Text.extract` inside it and fill type param with `Right` and the text param with `Hello, 世界🌍!` and length param with `6`.

   ![](/files/DE6cbXyn8BmUz7XM0P4r)
4. Add `Log.write` function and add a subflow on it's value, then put `Text.extract` inside it and fill type param with `Middle` and the text param with `Hello, 世界🌍!` and length param with `5` and start param with `7`.

   ![](/files/yFQsVMoyGKHojhZ7KKnh)

### Result

1. The console on preview will show us the formatted text value `Hello`, `世界🌍!` & `世界🌍!`.

   ![](/files/L3PJI2B40zrdWqySuDNx)

## Links

### Related Information


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/react-native/text/extract.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
