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

```
STRING std.strstr(STRING haystack, STRING needle)
```

**Available in:** all subroutines

Returns the part of `haystack` string starting from and including the first 
occurrence of `needle` until the end of `haystack`. If `needle` is not found,
a _not set_ string value is returned.

## Example

```vcl
set req.http.X-qs = std.strstr(req.url, "?");
```
