title: Split string every 20 characters and then print each section to console
body: <p>Okay so, I am trying to do something for a larger project and I need to split a string every 20 characters and then print each section to console with a delay of 1 second between each input
  I tried to do:</p>
  
  <pre><code>if  (x==true){
    String[] Text = JOptionPane.showInputDialog("Input string").split(null, 20);
    for (int i = 0; i &lt; Text.length; i++) {
      String splitText = (Text[ i ]);
      try {
        Thread.sleep(1000);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
      System.out.println(splitText);
    }
  }
  </code></pre>
  
  <p>But it didn't work (I'm not very experienced with java, sorry.)<br>
  Does anyone have any idea of what would work?<br>
  (if you could rewrite my code to something that works and explain it that would be fantastic but any help is appreciated).</p>