2014-01-05 12:27:12 -08:00
|
|
|
IO.print("".contains("")) // expect: true
|
|
|
|
|
IO.print("anything".contains("")) // expect: true
|
|
|
|
|
IO.print("something".contains("meth")) // expect: true
|
|
|
|
|
IO.print("something".contains("some")) // expect: true
|
|
|
|
|
IO.print("something".contains("ing")) // expect: true
|
|
|
|
|
IO.print("something".contains("math")) // expect: false
|
2015-01-22 15:28:54 -08:00
|
|
|
|
|
|
|
|
// Non-ASCII.
|
|
|
|
|
IO.print("søméthîng".contains("méth")) // expect: true
|
|
|
|
|
IO.print("søméthîng".contains("meth")) // expect: false
|
2015-02-04 13:58:16 +01:00
|
|
|
|
2015-02-04 20:26:29 -08:00
|
|
|
// 8-bit clean.
|
2015-02-04 13:58:16 +01:00
|
|
|
IO.print("a\0b\0c".contains("\0")) // expect: true
|
|
|
|
|
IO.print("a\0b\0c".contains("b")) // expect: true
|
|
|
|
|
IO.print("a\0b\0c".contains("b\0c")) // expect: true
|
|
|
|
|
IO.print("a\0b\0c".contains("bc")) // expect: false
|