# 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://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Fxhk4dCD1hmAkaNZimY7c%2F0.png?alt=media" 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://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FzAmNbH5l5nUi2WJbtHbD%2F1.png?alt=media)

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://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FrGypj1MNsa1naKXwvsN7%2F2.png?alt=media)
