# Ends-with test

Learn how to check if a string ends with a specific suffix.

This test checks if a string ends with another string.

A string ends with another string if the latter is a suffix of the former. For example, `"Hello world"` ends with `"world"`.

The test is case-sensitive, meaning that the strings must match exactly, including the case of the letters.

> **Empty strings are everywhere!**
>
> An empty string is a suffix of every string. It follows a math concept called [vacuous truth](https://en.wikipedia.org/wiki/Vacuous_truth), which says that an [empty set](https://en.wikipedia.org/wiki/Empty_set) is a part of every set.

## Syntax

This test has the following syntax:

```cql
/*<value>*/ ends with /*<suffix>*/
```

To negate the test, you can write:

```cql
/*<value>*/ does not end with /*<suffix>*/
```

## Parameters

These are the supported parameters:

- `value`: `string`

  The string to validate.

- `suffix`: `string`

  The suffix that the string may end with.

## Examples

Here is a basic example that checks if a string ends with another string:

```cql
"Hello world" ends with "world" // true
```

You can negate the test to verify the contrary:

```cql
"Hello world" does not end with "world" // false
```
