2015-01-10 14:45:14 -08:00
|
|
|
IO.print("abcd".startsWith("cd")) // expect: false
|
|
|
|
|
IO.print("abcd".startsWith("a")) // expect: true
|
|
|
|
|
IO.print("abcd".startsWith("abcd")) // expect: true
|
|
|
|
|
IO.print("abcd".startsWith("abcde")) // expect: false
|
2015-01-11 19:13:15 -08:00
|
|
|
IO.print("abcd".startsWith("")) // expect: true
|
2015-01-22 15:28:54 -08:00
|
|
|
|
|
|
|
|
// Non-ASCII.
|
|
|
|
|
IO.print("søméthîng".startsWith("sømé")) // expect: true
|
|
|
|
|
IO.print("søméthîng".startsWith("some")) // expect: false
|
2015-02-04 13:58:16 +01:00
|
|
|
|
|
|
|
|
// 8-bit clean
|
|
|
|
|
IO.print("a\0b\0c".startsWith("a")) // expect: true
|
|
|
|
|
IO.print("a\0b\0c".startsWith("a\0")) // expect: true
|
|
|
|
|
IO.print("a\0b\0c".startsWith("b\0")) // expect: false
|