This may seem like a basic question, indeed it is, but it's been giving me a headache the last few days...

I'm an experienced final year CompSci student, producing a synchronisable organiser for the Nokia 7650/3650.

However, Integer.parseInt(str) always returns a NumberFormatException even when I know str contains, for example, "2". Why is this?

Does it matter if the string was converted from a char, which was in turn read from an inputstream?

Many thanks for any help....