integer to string issue
<p>In my Java program I receive a string from my Arduino by the serial port.<br>
The string is stored in variable (string) : result.</p>

<p>An example of what the data could be: 'w: 125' (always 1 character, a colon, and a space, with a analog value from my Arduino)</p>

<p>In my code I do:</p>

<pre><code>int spacePos = result.indexOf(" "); // search where the space is
number= result.substring(spacePos+1); // take everything what comes behind the space
System.out.println(number); // print the value, example : 125
int number2 = Integer.parseInt(number);// this should convert the String 125 to a integer with value 125
System.out.println(number2);// should print a integer with value 125
</code></pre>

<p>The part with substring works; I think. When I print the number I can see the 125 in the output screen of NetBeans, but I can select a few spaces??? behind my number.<br>
But when I print number2, I don't see anything.</p>

<p>Any assistance you may provide is appreciated.  Thanks.</p>
