Here you can find the source of getIndexesOf(String word, String value)
public static List<Integer> getIndexesOf(String word, String value)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static List<Integer> getIndexesOf(String word, String value) { List<Integer> indexes = new ArrayList<Integer>(); for (int index = word.indexOf(value); index != -1; index = word.indexOf(value, index + 1)) { indexes.add(index);//ww w . j a va2 s . c om } return indexes; } }