public static int strSearchKMP(String subS, String longS){
		int[] next = new int[subS.length()];
		for (int i = 0;i<subS.length();i++){
			String t = subS.substring(0,i+1);
			next[i]=t.length();
			int j = t.length()-1;
			while(j>0){
				String prefix =t.substring(0, j);
				String suffix = t.substring(t.length() - j);
				if (prefix.equals(suffix)){
					next[i] = t.length()-j;
					break;
				}
				j--;
			}
		}
		for (int i=0; i<next.length;i++){
			
			System.out.print(next[i]+", ");
		}
		System.out.println("");
		int index=0;
		
		while(index<longS.length()-subS.length()+1){
			int i;
			for( i =0;i<subS.length();i++){
				if(subS.charAt(i)!=longS.charAt(index+i)){
					break;
				}
			}
			
			if (i ==subS.length()){
				return index;
			}else if(i==0){
				index++;
			}else{
				index+=next[i-1];
			}
		}

		return -1;
	}