Check out v4 of the Fauna CLI

v4 of the Fauna CLI is now in beta.

The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start.

string.endsWith()

Test if a String ends with a provided suffix.

Signature

endsWith(suffix: String) => Boolean

Description

Tests if the calling String ends with a provided suffix. An exact match returns true. Otherwise, the method returns false.

Parameters

Parameter Type Required Description

suffix

String

true

Suffix to compare to the end of the calling String.

Return value

Type Description

Boolean

If true, the calling String ends with the suffix. Otherwise, false.

Examples

  1. Test whether a String ends with 200 OK:

    "HTTP/1.1 200 OK".endsWith("200 OK")
    true
  2. Test whether a String ends with 200:

    "HTTP/1.1 200 OK".endsWith("200")
    false

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!