fork(1) download
  1. class Ideone {
  2. public static void main (String[] args) {
  3. String str = "kkkthekkkthe";
  4. int count = str.split("the", -1).length - 1;
  5. System.out.println(count);
  6. }
  7. }
Success #stdin #stdout 0.06s 32024KB
stdin
Standard input is empty
stdout
2