Einzelnen Beitrag anzeigen
Alt 16.11.2003, 13:31   #3
jak
Inventar
 
Registriert seit: 13.06.2001
Beiträge: 1.830


Standard

Ich glaub wohl eher Uni...
Falls du Wirtschaftsinformatik studierst:

ansonsten:
Code:
private boolean count (String what){
 char[]w=what.toCharArray();
 int max=3,count=0,i=0;
 charToCount=w[0];
 if (charToCount=='M') max=4;
 boolean loop=true;
 while (loop){
  if (i<w.length) loop=w[i]==charToCount;
  count++;
  i++;
 }
 return count<=max;
}
Der Funktion müsstest du entweder die einzelnen Teilstrings übergeben (also alle aufeinanderfolgenden Buchstaben) oder du überarbeitest sie etwas.

Jak
____________________________________
Join the DNRC | Godwin\'s Law (thx@stona)
Documentation is like sex: If it\'s good, it\'s very, very good. If it\'s bad, it\'s better than nothing.
\"In theory, theory and practice are the same. In practice, they are not\" (Lawrence Berra)
jak ist offline   Mit Zitat antworten