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;
	}
}
@@ -520,13 +520,8 @@
  j++
-, i++
 ) %7B%0A
@@ -533,32 +533,36 @@
 if (originChar%5Bi
+ + j
 %5D == subChar%5Bj%5D)
@@ -602,29 +602,13 @@
 %09%09%09%09
-i = originChar.length
+break
 ;%0A%09%09

add file for chapter_001_6