# length

## Description

Counts the total number of characters in the text.

## Input / Parameter

| Name | Description             | Input Type | Default | Options | Required |
| ---- | ----------------------- | ---------- | ------- | ------- | -------- |
| text | The text to be counted. | Text       | -       | -       | Yes      |

## Output

| Description               | Output Type |
| ------------------------- | ----------- |
| Returns the total length. | Number      |

## Example

In this example, we will count the total length of a string.

### Steps

1. Drag a `button` component into the canvas and open the `Action` tab. Select the `press` event of the button.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-9a6012636bd5dc82776f689feb768eca4fc94294%2Flength-step-1.png?alt=media)
2. Add `Log.write` function and add a subflow on it's value.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-20d8d8dee5a42a4d6463c631838d80d97b2f696e%2Flength-step-2.png?alt=media)
3. Then put `Text.length` inside it and fill the text "Hello World!"

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-3b8d0651937576949c027e621a2f2efcebd48b64%2Flength-step-3.png?alt=media)

### Result

1. The console will return the total length of text.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-97090e32c877e1c8c8528f8e585ed10b539ab84f%2Flength-result.png?alt=media)
