/**

Das Programm liefert etwa folgenden Dialog:

char c = aktuell.charAt(2); // 'v'  : v
pos = ooSprachen.indexOf("Java"): 10
int pos = ooSprachen.indexOf(',') ab 5: 8
b = true

*/
/*------------------------------------------------------------------*/

class StringDemo2
{
   public static void main(String[] arg)
   {
      String ooSprachen = "C++, Ada, " + "Java";
      String bearbeiter = new String("Meyer");

      String aktuell = ooSprachen.substring(10, 14);
      // TeilString von ooSprachen von 10 inklusive
      // bis 14 exklusive, also "Java"
      char c = aktuell.charAt(2);         // 'v'
      // Buchstabe an Stelle 2 von Java (gezählt ab 0)
      System.out.println("char c = aktuell.charAt(2); // 'v'  : " + c);

      int pos = ooSprachen.indexOf("Java");   // 10
      System.out.println("pos = ooSprachen.indexOf(\"Java\"): " + pos);

      pos = ooSprachen.indexOf(',', 5);        // 8
      // Index des erste Kommas ab Index 5
      System.out.println("int pos = ooSprachen.indexOf(',') ab 5: " + pos);

      boolean b = ooSprachen.regionMatches(true, 10, "Die JAVA-Sprache", 4, 4);
      System.out.println("b = " + b);
   }
}

