# pick.key-substring()

The `pick.key-substring()` function returns a copy of [`$map`](#usdmap) with keys of [`$substrings`](#usdsubstrings...).

{% code lineNumbers="true" %}

```scss
// Sass.
@use 'sass:map';

// Modules.
@use '../../string';

// The `pick.key-substring()` or `map.pick-key-substring()` function.
@function key-substring($map, $substrings...) {
  $result: ();
  @each $substring in $substrings {
    @if type-of($substring) == string {
      @each $key in map.keys($map) {
        @if type-of($key) == string and string.index($key, $substring) {
          $result: map.deep-merge(
            $result,
            (
              $key: map.get($map, $key),
            )
          );
        }
      }
    }
  }
  @return $result;
}
```

{% endcode %}

{% embed url="<https://github.com/angular-package/sass/blob/main/map/pick/_pick.key-substring.function.scss>" %}

### Parameters

#### `$map`

A map from which keys of values of [`$types`](#usdtypes...) are picked.

#### `$substrings...`

Substrings of keys to pick from a [`$map`](#usdmap).

### Return

The return value is a copy of [`$map`](#usdmap) with keys associated with [`$substrings`](#usdsubstrings...).

## Examples

```scss
// Use.
@use '@angular-package/sass/map';

// Examples.


```
