package ru.job4j;

/**.
*
* @author Anton Vasilyuk
* @version 1.0
* @since 0.1
*/

public class OriginAndSubString {
	/**.
	* Method for cheking string
	* @param origin string
	* @param sub string
	* @return result
	*/
	public boolean contains(String origin, String sub) {
		char[] originChar = origin.toCharArray();
		char[] subChar = sub.toCharArray();
		int n = 0;
		boolean result = false;
		for (int i = 0; i < originChar.length; i++) {
			if (originChar[i] == subChar[0]) {
				for (int j = 0; j < subChar.length; j++, i++) {
					if (originChar[i] == subChar[j]) {
						n = n + 1;
					}
				}
				i = originChar.length;
			}
		}
		if (n == subChar.length) {
			result = true;
		}
		return result;
	}
}
add file for chapter_001_6