endsWith

Modified on Wed, 16 Aug 2023

Description

Check if string ends with the given target string

Syntax

ends_with(text, target)

Parameters

Input ParameterTypeDescription
textstringThe string to inspect.
targetstringThe string to search for

Return value

Type
boolean

Sample

ExampleResultDescription
ends_with('abcd', 'cd')trueCheck if the text ends with 'cd'
ends_with('abcd', 'b')falseCheck if the text ends with 'b'

To view all the String functions, click here.