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++) {
					if (originChar[i + j] == subChar[j]) {
						n = n + 1;
					}
				}
				break;
			}
		}
		if (n == subChar.length) {
			result = true;
		}
		return result;
	}
}
@@ -591,26 +591,55 @@
 %09%09%09%7D
-%0A%09%09%09%09%7D
+ else %7B%0A%09%09%09%09%09%09n = 0;
 %0A%09%09%09%09
+%09%09
 break;%0A
+%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A
 %09%09%09%7D

add file for chapter_001_6