Weird maybe silly problem with String Tokenizer
Hi, i'm new to this forum but i'm a bit stuck a piece of code. It's part of a simple upd server. I can't get it to match the second part of the cSentence String. If someone could give me tip it would be much appreciated.
TIA
L.
...
String cSentence = new String(receivePacket.getData());
// TEST!!!!
System.out.println(cSentence + "."); // E.g. "Login 48123"
StringTokenizer st = new StringTokenizer(cSentence);
String request = new String(st.nextToken());
if ((st.countTokens() >= 1) && request.equals("Login")) {
String a = st.nextToken();
// TEST!!!!
System.out.println(a + ".");
System.out.println(password + "."); // These two seem to print the same result. E.g. "48123"
if (a.equals(password)) {.....} // But this fails. But why?
....

