> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metrics-man.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Endswith

# \$endsWith

The `$endsWith` operator checks if the first string ends with the second string.

## Input

* An array containing exactly two string values: the main string and the suffix to check

## Output

* `true` if the first string ends with the second string
* `false` otherwise

## Examples

### Ends With

```json theme={null}
{
  "$endsWith": [
    "Hello, world!",
    "world!"
  ]
}
```

Result: `true`

### Does Not End With

```json theme={null}
{
  "$endsWith": [
    "Hello, world!",
    "Hello"
  ]
}
```

Result: `false`

### Field Value

```json theme={null}
{
  "$endsWith": [
    {
      "$input": "url"
    },
    ".pdf"
  ]
}
```

Result: `true` if the url field ends with ".pdf", otherwise `false`
