Wednesday, 5 October 2016

Array list to String



String a=Arrays.toString(Test_Array.toArray()).replaceAll("\\[|\\]", "").replaceAll(" ","\t");

Or

                      String str = Id_Array.toString();
                       System.out.println("Step-1 : " + str);

                       str = str.replaceAll("[\\[\\]]", "").replaceAll(" ", "");

                       System.out.println("Step-2 : " + str);

Publish by KASHIF AHMED

No comments:

Post a Comment