Hello,
I've been placed on a web analytics project to try and get so me Java experience/web development. I have very little Java knowledge, and hoping that you guys can help me out a little.
I have been asked to come up with a Java method that takes a URL string and alphabetizes the parameters. This is what i was given to start...
I have no idea what this does or even where to start. Any help/guidance would be great!
I've been placed on a web analytics project to try and get so me Java experience/web development. I have very little Java knowledge, and hoping that you guys can help me out a little.
I have been asked to come up with a Java method that takes a URL string and alphabetizes the parameters. This is what i was given to start...
Code:
int questionPos = inUrl.indexOf("?"); if (questionPos >= 0) { StringBuffer sb = new StringBuffer(inUrl.substring(0, questionPos + 1)); StringTokenizer tokenizer = new StringTokenizer(inUrl.substring(questionPos + 1), "&", true); while (tokenizer.hasMoreTokens()) { String key = tokenizer.nextToken(); } }
I have no idea what this does or even where to start. Any help/guidance would be great!
Comment