---
title: "contains(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/stringprotocol/contains(_:)-40kbf"
---

# contains(_:)

Returns true if other is non-empty and contained within self by case-sensitive, non-literal search. Otherwise, returns false.

## Declaration

```swift
func contains<T>(_ other: T) -> Bool where T : StringProtocol
```

## Discussion

Discussion Equivalent to self.range(of: other) != nil
