Skip to content

Instantly share code, notes, and snippets.

@ar-android
Created September 30, 2015 03:48
Show Gist options
  • Select an option

  • Save ar-android/9989e6734f6875cf34b3 to your computer and use it in GitHub Desktop.

Select an option

Save ar-android/9989e6734f6875cf34b3 to your computer and use it in GitHub Desktop.
Split comma and create array from string with comma
String str = "http://1.bp.blogspot.com/-huU2LE_jd64/VcWhPWiVlgI/AAAAAAAB3TY/rhEjlFqT3k4/s1600/01.jpg, http://4.bp.blogspot.com/-NQ69kOrdDR4/VcWhP_OnyRI/AAAAAAAB3Tg/qVK_gWB2Xtk/s1600/02.jpg, http://4.bp.blogspot.com/-N-YBUev9L4Q/VcWhP4eT7iI/AAAAAAAB3Tc/FURv3WXZ0gI/s1600/03.jpg, http://3.bp.blogspot.com/-sD0voY50m3o/VcWhQ2pSZnI/AAAAAAAB3Tw/k9Hy3J_EvdU/s1600/04.jpg, http://4.bp.blogspot.com/-oe8ggexHGUk/VcWhRjWZw_I/AAAAAAAB3T0/PoN9-UfaeCc/s1600/05.jpg,http://4.bp.blogspot.com/-ICqCe72dxNc/VcWhRhZTyDI/AAAAAAAB3T4";
ArrayList aList= new ArrayList(Arrays.asList(str.split(",")));
for(int i=0;i<aList.size();i++)
{
System.out.println(String.valueOf(i)+aList.get(i));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment