Reputation: 105
I have a String
called new_alpha
which contains only characters (no whitespace). How do I split it so that each character is a different element in a new ArrayList
?
Upvotes: 0
Views: 68
Reputation: 1
int len=new_alpha.length();
ArrayList<Character> arr=new ArrayList<Character>();
for(int i=0;i<len;i++)
{ arr.add(new_alpha.charAt(i));
}
Your all character of String convert into ArrayList;
Upvotes: 0