Java String Index Of getIndexesOf(String word, String value)

Here you can find the source of getIndexesOf(String word, String value)

Description

get Indexes Of

License

Open Source License

Declaration

public static List<Integer> getIndexesOf(String word, String value) 

Method Source Code


//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;
    }
}

Related

  1. getAllIndex(String source, String rex)
  2. getIndexOfChar(String str, String start, String end)
  3. getIndexOrConstraintName(String command)
  4. getIndexString(T array, String indexPrefix, String separatorPrefix)
  5. getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength)