---
title: "contains(_:)"
framework: appintentstesting
role: symbol
role_heading: Type Method
platforms: [iOS 27.3+, iPadOS 27.3+, Mac Catalyst 27.3+, macOS 27.3+, tvOS 27.3+, visionOS 27.3+, watchOS 27.3+]
path: "appintentstesting/intentvalueexpectation/contains(_:)"
---

# contains(_:)

Creates an expectation that requires the value to be a string that contains a substring.

## Declaration

```swift
static func contains(_ substring: String) -> Self
```

## Parameters

- `substring`: The text to search for in the string.

## Return Value

Return Value An expectation that searches a string value for substring.

## Discussion

Discussion The comparison is exact and case-sensitive. A value that isn’t a string doesn’t satisfy the expectation.
