I am trying to get the characters or the letters from a word.
For example:
input = "apple"
output = "a", "p", "p", "l", "e"
However, I am using the BufferedReader
class.
Is there any way to read characters using BufferedReader
?
Thank you
String input = "apple";
char[] arr = input.toCharArray();
System.out.println(Arrays.toString(arr));
Output:
[a, p, p, l, e]
The read()
method of BufferedReader
gives you a single character.
Have a look at this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With