mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-16 20:28:04 +01:00
16 lines
608 B
Plaintext
16 lines
608 B
Plaintext
IO.print("abcd".endsWith("cd")) // expect: true
|
|
IO.print("abcd".endsWith("abcde")) // expect: false
|
|
IO.print("abcd".endsWith("abcd")) // expect: true
|
|
IO.print("abcd".endsWith("f")) // expect: false
|
|
IO.print("abcd".endsWith("")) // expect: true
|
|
|
|
// Non-ASCII.
|
|
IO.print("søméthîng".endsWith("thîng")) // expect: true
|
|
IO.print("søméthîng".endsWith("thing")) // expect: false
|
|
|
|
// 8-bit clean.
|
|
IO.print("a\0b\0c".endsWith("\0")) // expect: false
|
|
IO.print("a\0b\0c".endsWith("c")) // expect: true
|
|
IO.print("a\0b\0c".endsWith("\0c")) // expect: true
|
|
IO.print("a\0b\0c".endsWith("\0b")) // expect: false
|