<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLWordEmbedding/contains(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Create ML",
      "CreateML"
    ],
    "preciseIdentifier" : "s:8CreateML15MLWordEmbeddingV8containsySbSSF"
  },
  "title" : "contains(_:)"
}
-->

# contains(_:)

Returns a Boolean value indicating whether the vocabulary contains the given string.

```
func contains(_ text: String) -> Bool
```

## Parameters

`text`

The string to find in the vocabulary.

## Return Value

`true` if the string was found in the vocabulary; otherwise, false.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)