package Algorithmus;

public class Allgemeine_Übungen {

	public static void main(String[] args) {
		String text = "HalloWelt";
		String o = "o";
		 text.substring(0, 0);
		int x = indexof(text,o); 
		System.out.println(x);
	}
	
	public static int indexof(String text,String s) {
		for (int i = 0; i < text.length(); i++)
			if (text.charAt(i) == s.charAt(0))
				return i;
		return 0;
	}
	
	
	
	public static void find_Sub_Array(int[] arr, int target) {
		
		int merker = 0;
		for (int i = 0; i < arr.length -1 ; i++) {
			merker = arr[i];
			for (int j = i + 1; j < arr.length; j++) {
				merker += arr[j];
				if (merker == target) {
					System.out.println("Ab Index: " + i + " bis Index: " + j + " sind die Summer der Zahl: " + target);
					break;
				}
			}
		}
		
	}

}
