public static int searchWithKMP(String originalStr, String targetStr){

		if (null==originalStr||null==targetStr){
			throw new IllegalArgumentException("the both args can not be null");
		}

		if (originalStr.length()<targetStr.length()){
			return -1;
		}

		int index=0;

		int[] nextArr=next(targetStr);

		for (int i=0;i<originalStr.length();i++){

			while (index>0 && originalStr.charAt(i)!=targetStr.charAt(index)){
				index=nextArr[index];
			}

			if (originalStr.charAt(i)==targetStr.charAt(index)){		//equal at i
				index++;

				if (index==targetStr.length())
					return i-index+1;
			}
		}

		return -1;
	}