[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Type](https://evolu.dev/docs/api-reference/common/Type) › includes

```ts
function includes<Substring extends string>(
  substring: Substring & ValidateLiteral<Substring>,
): BrandFactory<`Includes${Substring}`, string, IncludesError<Substring>>;
```

Defined in: [packages/common/src/Type.ts:8090](https://github.com/evoluhq/evolu/blob/bc4578a260dd15d5bbf94b83765ca05984d194cb/packages/common/src/Type.ts#L8090)

String [Brand](https://evolu.dev/docs/api-reference/common/Brand/interfaces/Brand) requiring an exact, case-sensitive substring.

The substring may occur anywhere, including across line breaks. Validation
preserves the complete string. Every string contains the empty string, so an
empty substring accepts every string allowed by the parent Type. The
substring must be one concrete string literal so different substrings have
distinct brands.

Like `String.prototype.includes`, matching compares UTF-16 code units, so a
precomposed `é` does not match `e` followed by a combining accent. Use
[normalized](https://evolu.dev/docs/api-reference/common/Type/functions/normalized) to require one Unicode normalization form.

### Example

```ts
import {
  assertEqual,
  assertErr,
  assertOk,
  assertType,
  includes,
  maxLength,
  String,
  type Brand,
} from "@evolu/common";

const Greeting = includes("{name}")(maxLength(100)(String));

const greeting = Greeting.fromUnknown("Hello, {name}!");
assertOk(greeting, "Hello, {name}!");
assertType<
  typeof greeting.value,
  string & Brand<"MaxLength100"> & Brand<"Includes{name}">
>();

const invalid = Greeting.fromUnknown("Hello, {Name}!");
assertErr(invalid, {
  type: "Includes{name}",
  value: "Hello, {Name}!",
  substring: "{name}",
});
assertEqual(
  Greeting.formatError(invalid.error),
  'The value "Hello, {Name}!" must contain "{name}".',
);
```