# LeftOf (String)

| **Name**    | ***LeftOf***                                                                                                                                                      |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax      | LeftOf (String str, String lookFor)                                                                                                                               |
| Purpose     | To search str for lookFor and, if found, to return all characters before it.                                                                                      |
| Description | If the string is found, returns all the characters to the left of the specified string. Otherwise, returns an empty string.                                       |
| Return Type | String                                                                                                                                                            |
| Parameters  | <p>str \[System.String] – String that will be searched and whose part will be returned</p><p>lookFor \[System.String]</p><p>isCaseSensitive \[System.Boolean]</p> |

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FrIYyjRKJnmraIwY3LGWF%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* = ABCDEFG

*lookFor* = e

*isCaseSensitive* = False

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

Right-click on the function transformation object and select *Preview Output.* You can see that Astera Data Stack has returned all the characters to the left of the specified string value.

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