获取指定字符串标志的字符串出现的索引位置
/**
* 获取指定字符串标志的字符串出现的索引位置
* @Date 2017年10月30日 11:11:07
* @param value
* @param operator
* @param index
*
* @return
*/
private int getCharacterPosition(String value, String operator, int index) {
Matcher matcher = Pattern.compile(operator).matcher(value);
int mIdx = 0;
while (matcher.find()) {
mIdx++;
if (mIdx == index) {
break;
}
}
return matcher.start();
}