Skip to main content
Version: Next

String Ends With

Determines whether the s1 ends with the characters of string s2

Description

Determines whether a string ends with the characters of a specified string, returning true or false as appropriate.

Uses the endsWith JavaScript function.

See <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank">string object</a>.

Inputs

  • s1 (String): The string to search.
  • s2 (String): The string to be searched for at the end of s1.
  • length (Number): Used as the length of str. Defaults to -1 which means s1.length.

Outputs

  • s1.endsWith(s2) (Boolean): true if s1 ends with s2