I have just done this in eclipse:
String firstInput = removeSpaces(myIn.readLine());
String first = new String(firstInput.charAt(0));
However, eclipse complains that:
The constructor String(char) is undefined
How do I convert a char to a string then??
Thanks
I tried the substring method but it didn't work for some reason but gandalf's way works for me just fine! Very straightforward!
Easiest way?
String x = 'c'+"";
or of course
String.valueOf('c');
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments