title: How to convert a String array to char array in Java
body: <p>We are given an array of Strings and what we require is a char[], i.e, array of all characters in all the Strings
  For example:</p>
  
  <p>Input: [i, love, you]</p>
  
  <p>output: [i, l, o, v, e, y, o, u]</p>
  
  <p>First I made an array of arrays.</p>
  
  <p>Then I have found the length of the required char[] array.</p>
  
  <p>I have tried the following so far:</p>
  
  <pre><code>char[][] a1 = new char[str.length][];
  
  for(int i =0;i&lt;str.length;i++){
      a1[i]=str[i].toCharArray();
  }
  
  int total=0;
  for(int i =0;i&lt;str.length;i++){
      total = total + a1[i].length;
  }
  
  char[] allchar = new char[total];
  
  for(int i=0;i&lt;str.length;i++){
      //NOW HERE I WANT TO MERGE ALL THE char[] ARRAYS TOGETHER.
  //HOW SHOULD I DO THIS?
  }
  </code></pre>