instance method String#endsWith

View source on GitHub →

String#endsWith(substring) → Boolean

Checks if the string ends with substring.

Example
'slaughter'.endsWith('laughter')
// -> true