Skip to content

endsWith rule (v3)

Require the input value to end with a given string.

Since
1.1.0
Signature
endsWith(input, string)
Options
1

Usage

endsWith usage
bootstrapValidate('#input', 'endsWith:UCV:Your Input needs to end with UCV')

Options

Name Description Example
string string: String the input value should end with UCV

Live Example

Checking...

Source

endsWith source
/**
* @since 1.1.0
* @example UCV
* @error Your Input needs to end with UCV
* @param string string: String the input value should end with
* @description Require the input value to end with a given string.
*/
export default function endsWithRule(input: RuleInput, string: RuleOption) {
return endsWith(input.value, String(string));
}