How to divide string to single chars and put them in the array?
<p>I realise it's pretty basic.</p>

<p>I need to ask user for an string input. Then I divide string to single char array and print it in a console. I have to ignore spaces</p>

<p>Tried this but when I input "this is test string" as output I get only {t h i s}</p>

<pre><code>    String tekst;        
    Scanner odczyt = new Scanner(System.in);
    System.out.println("Wpisz tekst");
    tekst = odczyt.next();
    int iloscZnakow = tekst.length();
    char tablica[] = new char[iloscZnakow];
    tablica = tekst.toCharArray();
    System.out.println(Arrays.toString(tablica));
</code></pre>
