# SJS.ENDWITH

## Content

This function returns whether the text ends with the given string.

## Syntax

`=SJS.ENDWITH(text, searchString, [match_mode])`

## Arguments

This function has the following arguments:

| Argument | Description |
| -------- | ----------- |
| *text* | [Required] The piece of text you want to process. |
| *searchString* | [Required] Use this text to match the original text, whether it is the ending text of the original text, no wildcards are allowed. |
| *match\_mode* | [Optional] Determines whether the text match is case-sensitive or not.<br>It can be set as follows：<ul><li>**0** : Case sensitive</li><li>**1** : Case insensitive</li></ul>The default value is case-sensitive. |

## Examples

`=SJS.ENDWITH("Little red Riding Hood's red hood","hood") // true`
`=SJS.ENDWITH("Little red Riding Hood's red hood","HOOD") // false`
`=SJS.ENDWITH("Little red Riding Hood's red hood","Hood", 1) // true`

## Errors

This returns a #N/A! error if any of the following conditions is true:

* text.length = 0
* searchString.length = 0
* searchString is greater than the length of the text.