Split String and for loop issues. (Beginner problems)
Well Im trying to get the string called URL to be split at the & and = signs but im running into a few errors using tokens. Its a simple code but the tokens keep saying its unresolved. my code:
public class URL {
public static void main(String[] args) {
String URL = "NAME=Greg&EMAIL=G@email.edu&SSNO=12345678&PREVCOU RSES=Math+110&REASON=To+learn+programming&Special+ Interests=robots";
String() token = URL.split("&");
for (String t ; ta)
(
String() A= t.split("=");
for (String h ; A);
System.out.println(URL);
}
}
Re: Split String and for loop issues. (Beginner problems)
What is the actual error? Check your syntax, you've got quite a few errors here.
Also, please use the highlight tags when posting code.
Re: Split String and for loop issues. (Beginner problems)
Are you writing this code in some IDE like Netbeans /Eclipse ?and at what point you are getting the error i mean is it runtime or compile time,
Re: Split String and for loop issues. (Beginner problems)
There are definitely compile-time errors. The syntax is way off, and that needs to be fixed before we proceed.