Converting ArrayList to Array in java

前端 未结 10 1834
野的像风
野的像风 2020-12-04 18:44

I have an ArrayList with values like \"abcd#xyz\" and \"mnop#qrs\". I want to convert it into an Array and then split it with # as delimiter and have abcd,mnop in an array a

10条回答
  •  时光取名叫无心
    2020-12-04 19:22

    You don't need to reinvent the wheel, here's the toArray() method:

    String []dsf = new String[al.size()];
    al.toArray(dsf);
    

提交回复
热议问题