Hi all,
I want to change a char "firstnum" to a
string. Here is my code.
private static String firstNumber( String s )
{
char firstnum = s.charAt( 0 );
String x = Character.toString( firstnum );
return x;
}
And I get the error message:
cannot resolve symbol
symbol: method toString (char)
location: class java.lang.Character
String x = Character.toString( firstnum );
which makes it look like the method toString doesn't exist in the Character Class but it is in the method list in the API. I saw that all of the other methods in the API seemed to use the arguments in the method (in the brackets) but the toString method didn't have anything in the brackets in the API. I can use the boolean isDigit and everything works fine but not the toString method seems to be different.
Any help is much appreciated!
Thanks for your time
Don Croswell
What am I doing wrong.