Skip to content

Instantly share code, notes, and snippets.

@erikbgithub
Created September 27, 2010 11:11
Show Gist options
  • Save erikbgithub/598865 to your computer and use it in GitHub Desktop.
Save erikbgithub/598865 to your computer and use it in GitHub Desktop.
class Hausaufgabe {
public static int anzahl(String vieleZeichen, String b) {
if((vieleZeichen == null) || (vieleZeichen.isEqual("")) return 0;
String w = vieleZeichen.subString(0,vieleZeichen.length()-2);
String a = "" + vieleZeichen.getChar(vieleZeichen.length()-1);
if(a.isEqual(b)) return anzahl(w, b)+1;
if(!a.isEqual(b)) return anzahl(w,b);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment