View Single Post
Old 08-09-2003, 05:23 PM   #4 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,161
Belisarius is on a distinguished road
I don't know, I think standard libraries are fair game. After all, there's no sense in reinventing the wheel. I know the J2SE implementation of most objects/methods are going to be a lot more efficent than my implementations.

Anyways, Java:
Code:
public int getLength(){
  StringTokenizer toks = new StringTokenizer("Johnny Boy", "y");
  return toks.countTokens() - 1;
}
Changed it as I didn't notice that the goal was to count "y's" orignially.
__________________
GitS
Belisarius is offline   Reply With Quote