0

I want a user to input a word like hello and I want to split the word into an array of individual characters, like ["h", "e", "l", "l", "o"].

I've already tried the String#split() method, but I don't know what argument to use to split each letter.

Mateen Ulhaq
  • 24,552
  • 19
  • 101
  • 135
Zoran Savic
  • 11
  • 1
  • 1
  • 1

1 Answers1

-1
String s = "Hello";
char[] s_splitted = s.toCharArray();

Outputs an array with H as the first value, e as the second, etc.

luanjot
  • 1,176
  • 1
  • 7
  • 21