> For the complete documentation index, see [llms.txt](https://lara-dumps.gitbook.io/laradumps/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lara-dumps.gitbook.io/laradumps/commands/contains.md).

# Contains

Inspecting and debugging long strings for specific words can be tiresome and time consuming. Use the method contains() to check if the payload contains a specific string.

```php
$html   = '<select name="select-choice" id="select-choice"><option value="Choice 1">Choice 1</option><option value="Choice 2">Choice 2</option><option value="Choice 3">Choice 3</option></select>';

ds($html)->contains('Choice 3');

$string   = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quibusdam, quidem?';
$expected = 'muspi';

ds($string)->contains($expected);
```

![Contains](https://1925282274-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDBDrn5ZBe2jpKcdmPPrl%2Fuploads%2Fgit-blob-4d2943b8cdf0961f151361ba9fc94b3a76748ada%2Fcontains.png?alt=media)
