Some things to fix in your code - the charAt() method returns a character and in your if statement, you are comparing it to a string (the double quotes mean String). Secondly, you are not doing a comparison in your if statement - you are specifying an assignment. You need to use ==. Also, you need to add parantheses to the length method call - numword.length().
Here's the "fixed" code:
Hope this helps. JD [ January 05, 2005: Message edited by: John Dell'Oso ]
posted 13 years ago
Thankyou JD and everyone else. However, I've now moved on!
Taking the TEST example again, charAt(n) only gives me one charachter. What do I need if I want say the 2nd and 3rd chars? ie return ES