class Strings {

	public static String[] splitWhitespaces(String s) {
		if(null == s || s.length() == 0) {
			return Arrays2.EMPTY_STRING_ARRAY;
		}
		
		List<String> list = new ArrayList<String>();
		int i = 0, start = 0, len = s.length();
		boolean match = false;

		while (i < len) {
			if (Character.isWhitespace(s.charAt(i))) {
				if (match) {
					String token = s.substring(start, i).trim();

					if (token.length() > 0) {
						list.add(token);
					}
					
					match = false;
				}
				start = ++i;
				continue;
			}
			match = true;
			i++;
		}
		
		if(match) {
			String token = s.substring(start, i).trim();
			if(token.length() > 0) {
				list.add(token);
			}
		}

		return list.toArray(new String[list.size()]);
	}

	protected  Strings();

}