SplitScript reference / String / endsWith

String.endsWith

Method

String.endsWith(suffix: String) -> bool

Tests whether this string ends with an exact suffix.

Matching is case-sensitive over the UTF-8 text. Every string ends with the empty suffix.

Parameters

  • suffix: The suffix to compare.

Effects: pure

Runtime behavior: available everywhere; synchronous

Examples

Recognize completed scene names

let isCompleted = "Forest_Complete".endsWith("_Complete")