# case

## Description

Convert a string of text to lowercase, uppercase or capitalize.

## Input / Parameter

| Name | Description                                     | Input Type | Default | Options                            | Required |
| ---- | ----------------------------------------------- | ---------- | ------- | ---------------------------------- | -------- |
| type | The type of letter casing to apply to the text. | Text       | -       | Lowercase , Uppercase , Capitalize | Yes      |
| text | The value to be converted.                      | Text       | -       | -                                  | Yes      |

## Output

| Description             | Output Type |
| ----------------------- | ----------- |
| Returns formatted text. | String/Text |

## Example

In this example, we will format a text using case 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 its value, then put `Text.case` inside it and fill type param with `Lowercase` and the text param with `tesTing`.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-4113e19b97e3962c57a765b93767e66b200d8814%2Fcase-step-1.png?alt=media)
3. Add `Log.write` function and add a subflow on its value, then put `Text.case` inside it and fill type param with `Uppercase` and the text param with `tesTing`.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-e8a43cd8204e27d1e2d587dd244654456abae92f%2Fcase-step-2.png?alt=media)
4. Add `Log.write` function and add a subflow on its value, then put `Text.case` inside it and fill type param with `Capitalize` and the text param with `tesTing`.

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

### Result

1. The console on preview will show us the formatted text value `testing`, `TESTING` & `TesTing`.

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

## Links

### Related Information
