I know that the code to turn an arraylist into an array is:
private String[] arrayLst_to_array(ArrayList<String> al) {
String[] arr = new String[al.size()];
arr = al.toArray(arr);
return arr;
}
But I want my new array to have a certain string in the beginning and then after that, I want the rest of the arraylist.
I know that I could just add the string that I want to the beginning of the arraylist and then convert it, but is there a more efficient way?