public static boolean isSubstring(String pattern, String str) {
		int pattLength = pattern.length();
		int pattLoc = 0;
		char[] pattCharArr = pattern.toCharArray();
		char pattCurr = pattCharArr[pattLoc];
		
		int strLength = str.length();
		int strLoc = 0;
		char[] strCharArr = str.toCharArray();
		char strCurr;
		
		for(int i = 0; i < strLength; i++) {
			strLoc = i;
			strCurr = strCharArr[strLoc];
			
			while(pattCurr == strCurr) {
				if(strLoc >= strLength) {
					return false;
				}
				pattCurr = pattCharArr[pattLoc++];
				strCurr = strCharArr[strLoc++];
				if(pattLoc == pattLength) {
					return true;
				}
			}
		}
		return false;
	}