---
title: std.prefixof
summary: null
url: >-
  https://www.fastly.com/documentation/reference/vcl/functions/strings/std-prefixof
---

```
BOOL std.prefixof(STRING s, STRING begins_with)
```

**Available in:** all subroutines

True if the string `s` begins with the string `begins_with`. An empty string is 
not considered a prefix.

Returns `false` otherwise.

## Example

```vcl
set req.http.X-ps = std.prefixof("greenhouse", "green");
```
