<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MusicKit",
  "identifier" : "/documentation/MusicKit/MusicLibrarySectionedRequest/filterSections(matching:contains:)-3jf7b",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MusicKit"
    ],
    "preciseIdentifier" : "s:8MusicKit0A23LibrarySectionedRequestV14filterSections8matching8containsys7KeyPathCy0C6FilterAA0aC11RequestablePQzSSSgG_SStAaJRzrlF"
  },
  "title" : "filterSections(matching:contains:)"
}
-->

# filterSections(matching:contains:)

Filters sections by a given optional property that contains a specific string.

```
mutating func filterSections(matching keyPath: KeyPath<SectionType.LibraryFilter, String?>, contains text: String) where SectionType : MusicLibraryRequestable
```

---

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)