# TrimExtraMiddleSpace

| **Name**    | ***TrimExtraMiddleSpace***                                      |
| ----------- | --------------------------------------------------------------- |
| Syntax      | TrimExtraMiddleSpace (String str)                               |
| Purpose     | To return a string after removing any extra spaces in a string. |
| Description | Removes extra space from string at any position.                |
| Return Type | String                                                          |
| Parameters  | str \[System.String] – The string with extra spaces             |

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FhvnypydzlGehLLk163gi%2F0.png?alt=media)

**Example**

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

Where,

*str*: A B C

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FhS5em8bKYCzHL1EjMwzF%2F1.png?alt=media)

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FWDdiI3eRW2s3EH87zy5r%2F2.png?alt=media)

Right-click on the function transformation object and select *Preview Output.* You can see that Astera Data Stack has returned a string value, with any extra spaces removed.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FCS4FpZ1IDZAPVyHGsLbM%2F3.png?alt=media)
