2015-09-15 07:46:09 -07:00
|
|
|
System.print("".contains("")) // expect: true
|
|
|
|
|
System.print("anything".contains("")) // expect: true
|
|
|
|
|
System.print("something".contains("meth")) // expect: true
|
|
|
|
|
System.print("something".contains("some")) // expect: true
|
|
|
|
|
System.print("something".contains("ing")) // expect: true
|
|
|
|
|
System.print("something".contains("math")) // expect: false
|
2015-01-22 15:28:54 -08:00
|
|
|
|
|
|
|
|
// Non-ASCII.
|
2015-09-15 07:46:09 -07:00
|
|
|
System.print("søméthîng".contains("méth")) // expect: true
|
|
|
|
|
System.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-09-15 07:46:09 -07:00
|
|
|
System.print("a\0b\0c".contains("\0")) // expect: true
|
|
|
|
|
System.print("a\0b\0c".contains("b")) // expect: true
|
|
|
|
|
System.print("a\0b\0c".contains("b\0c")) // expect: true
|
|
|
|
|
System.print("a\0b\0c".contains("bc")) // expect: false
|