# Center (String)

| **Name**    | ***Center***                                                                                                           |
| ----------- | ---------------------------------------------------------------------------------------------------------------------- |
| Syntax      | Center (String str, Integer length)                                                                                    |
| Purpose     | To return a string value centered in accordance with the provided integer length.                                      |
| Description | Returns specified string centered according to the specified integer value. Returns zero if string is null.            |
| Return Type | String                                                                                                                 |
| Parameters  | <p>Str \[System.String] – String which will be centered</p><p>length \[System.Int64] – Length of the output string</p> |

<figure><img src="https://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/0%20(50).png" alt=""><figcaption></figcaption></figure>

**Example**

In this example, we are passing the required parameters to the function transformation object using a *Variables* object.

Where,

*str =* ABC

*length =* 20

![](https://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/1%20\(51\).png)

Right-click on the function transformation object and select *Preview Output.* You can see that Astera Data Stack has returned the specified string centered in accordance with the provided *length* value.

![](https://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/2%20\(51\).png)
