code: public static String[] splitString(String line) {
  		int len=line.length();
  		int wordCount=0;
  		int pos=0;
  		while(pos<len) {
  			// Skip past blank space
  			while(pos<len&&line.charAt(pos)<=' ') pos++;
  			int start=pos;
  			// Skip to the next blank space
  			while(pos<len&&line.charAt(pos)>' ') pos++;
  			if(pos>start) wordCount++;
  		}
  
  		String[] words=new String[wordCount];
  
  		int wordPos=0;
  		pos=0;
  		while(pos<len) {
  			// Skip past blank space
  			while(pos<len&&line.charAt(pos)<=' ') pos++;
  			int start=pos;
  			// Skip to the next blank space
  			while(pos<len&&line.charAt(pos)>' ') pos++;
  			if(pos>start) words[wordPos++]=line.substring(start,pos);
  		}
  
  		return words;
  	}
docs: Splits a <code>String</code> into a <code>String[]</code>.